From 94e99f38d94528f1333e63abf6537eef6bffa226 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 15 Sep 2022 12:18:11 +0100 Subject: [PATCH] add a break --- beta/src/content/apis/react/useCallback.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beta/src/content/apis/react/useCallback.md b/beta/src/content/apis/react/useCallback.md index 219f6ff7..864b653b 100644 --- a/beta/src/content/apis/react/useCallback.md +++ b/beta/src/content/apis/react/useCallback.md @@ -48,6 +48,8 @@ On the following renders, React will compare the dependencies In other words, `useCallback` caches a function between re-renders until its dependencies change. +--- + **To see how caching a function can help you optimize rendering, let's walk through an example.** Let's say that you're passing a `handleSubmit` function down from the `ProductPage` to the child `ShippingForm` component: ```js {5}