Fix typo in useMemo (product.id -> productId) (#5965)

This commit is contained in:
김정환
2023-04-29 01:31:36 +09:00
committed by GitHub
parent 52c777b2c3
commit 7ea43a8d92

View File

@@ -1126,7 +1126,7 @@ To memoize a function with `useMemo`, your calculation function would have to re
export default function Page({ productId, referrer }) {
const handleSubmit = useMemo(() => {
return (orderDetails) => {
post('/product/' + product.id + '/buy', {
post('/product/' + productId + '/buy', {
referrer,
orderDetails
});
@@ -1142,7 +1142,7 @@ This looks clunky! **Memoizing functions is common enough that React has a built
```js {2,7}
export default function Page({ productId, referrer }) {
const handleSubmit = useCallback((orderDetails) => {
post('/product/' + product.id + '/buy', {
post('/product/' + productId + '/buy', {
referrer,
orderDetails
});