From 149d5ff124e37693de26b0429cf0b7eae3327b02 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Wed, 15 Mar 2023 09:11:44 -0400 Subject: [PATCH] Fix typo in useCallback example (#5676) --- beta/src/content/reference/react/useCallback.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beta/src/content/reference/react/useCallback.md b/beta/src/content/reference/react/useCallback.md index de659d9ce..d01bea396 100644 --- a/beta/src/content/reference/react/useCallback.md +++ b/beta/src/content/reference/react/useCallback.md @@ -247,7 +247,7 @@ In this example, the `ShippingForm` component is **artificially slowed down** so 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. -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. +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.