diff --git a/src/content/reference/react/useCallback.md b/src/content/reference/react/useCallback.md index 9a1520f44d9..ed774d92cbd 100644 --- a/src/content/reference/react/useCallback.md +++ b/src/content/reference/react/useCallback.md @@ -52,7 +52,7 @@ export default function ProductPage({ productId, referrer, theme }) { On the initial render, `useCallback` returns the `fn` function you have passed. -During subsequent renders, it will either return an already stored `fn` function from the last render (if the dependencies haven't changed), or return the `fn` function you have passed during this render. +During subsequent renders, it will either return an already stored `fn` function from the last render (if the dependencies haven't changed), or return the `fn` function you have passed during this render. #### Caveats {/*caveats*/} @@ -224,7 +224,7 @@ function useCallback(fn, dependencies) { If your app is like this site, and most interactions are coarse (like replacing a page or an entire section), memoization is usually unnecessary. On the other hand, if your app is more like a drawing editor, and most interactions are granular (like moving shapes), then you might find memoization very helpful. -Caching a function with `useCallback` is only valuable in a few cases: +Caching a function with `useCallback` is only valuable in a few cases: - You pass it as a prop to a component wrapped in [`memo`.](/reference/react/memo) You want to skip re-rendering if the value hasn't changed. Memoization lets your component re-render only if dependencies changed. - The function you're passing is later used as a dependency of some Hook. For example, another function wrapped in `useCallback` depends on it, or you depend on this function from [`useEffect.`](/reference/react/useEffect)