Skip to content

Commit

Permalink
fix: invalid example in docs (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Arthur Geron <[email protected]>
  • Loading branch information
H0JLuk and Arthur Geron authored Dec 4, 2023
1 parent 123c276 commit a657d0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _**Note:**_ Use of memoization everywhere is not advised, as everything comes wi
***Correct***
```js
function useMyData({incomingData}) {
const parsedData = parseData(incomingData); // generated only when incomingData changes
const parsedData = useMemo(() => parseData(incomingData), [incomingData]); // generated only when incomingData changes
return parsedData; // Won't generate loops if used as a dependency in hooks.
}
Expand Down

0 comments on commit a657d0c

Please sign in to comment.