Skip to content

Commit 170e5b9

Browse files
authored
Remove unnecessary spaces from useCallback.md (#8006)
1 parent c8211fc commit 170e5b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/reference/react/useCallback.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function ProductPage({ productId, referrer, theme }) {
5252
5353
On the initial render, `useCallback` returns the `fn` function you have passed.
5454
55-
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.
55+
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.
5656
5757
#### Caveats {/*caveats*/}
5858
@@ -224,7 +224,7 @@ function useCallback(fn, dependencies) {
224224
225225
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.
226226
227-
Caching a function with `useCallback` is only valuable in a few cases:
227+
Caching a function with `useCallback` is only valuable in a few cases:
228228
229229
- 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.
230230
- 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)

0 commit comments

Comments
 (0)