Skip to content

Commit 149d5ff

Browse files
Fix typo in useCallback example (#5676)
1 parent 4c50846 commit 149d5ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beta/src/content/reference/react/useCallback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ In this example, the `ShippingForm` component is **artificially slowed down** so
247247
248248
Incrementing the counter feels slow because it forces the slowed down `ShippingForm` to re-render. That's expected because the counter has changed, and so you need to reflect the user's new choice on the screen.
249249
250-
Next, try toggling the theme. **Thanks to `useCallback` together with [`memo`](/reference/react/memo), it’s fast despite the artificial slowdown!** `ShippingForm` skipped re-rendering because the `handleSubmit` function has not changed. The `handleSubmit` function has not changed because both `productId` and `referral` (your `useCallback` dependencies) haven't changed since last render.
250+
Next, try toggling the theme. **Thanks to `useCallback` together with [`memo`](/reference/react/memo), it’s fast despite the artificial slowdown!** `ShippingForm` skipped re-rendering because the `handleSubmit` function has not changed. The `handleSubmit` function has not changed because both `productId` and `referrer` (your `useCallback` dependencies) haven't changed since last render.
251251
252252
<Sandpack>
253253

0 commit comments

Comments
 (0)