Skip to content

Commit 7ea43a8

Browse files
Fix typo in useMemo (product.id -> productId) (#5965)
1 parent 52c777b commit 7ea43a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/reference/react/useMemo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ To memoize a function with `useMemo`, your calculation function would have to re
11261126
export default function Page({ productId, referrer }) {
11271127
const handleSubmit = useMemo(() => {
11281128
return (orderDetails) => {
1129-
post('/product/' + product.id + '/buy', {
1129+
post('/product/' + productId + '/buy', {
11301130
referrer,
11311131
orderDetails
11321132
});
@@ -1142,7 +1142,7 @@ This looks clunky! **Memoizing functions is common enough that React has a built
11421142
```js {2,7}
11431143
export default function Page({ productId, referrer }) {
11441144
const handleSubmit = useCallback((orderDetails) => {
1145-
post('/product/' + product.id + '/buy', {
1145+
post('/product/' + productId + '/buy', {
11461146
referrer,
11471147
orderDetails
11481148
});

0 commit comments

Comments
 (0)