Browse Source

[Beta] Fix a word from useMemo to useCallback (#5334)

main
Dhaval Laiya 2 years ago
committed by GitHub
parent
commit
cc1687bd3c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/content/apis/react/useCallback.md

2
beta/src/content/apis/react/useCallback.md

@ -348,7 +348,7 @@ button[type="button"] {
In this example, the `ShoppingForm` implementation is also **artificially slowed down** so that you can see what happens when some React component you're rendering is genuinely slow. Try incrementing the counter and toggling the theme.
Unlike in the previous example, toggling the theme is also slow now! This is because **there is no `useMemo` call in this version,** so `handleSubmit` is always a new function, and the slowed down `ShoppingForm` component can't skip re-rendering.
Unlike in the previous example, toggling the theme is also slow now! This is because **there is no `useCallback` call in this version,** so `handleSubmit` is always a new function, and the slowed down `ShoppingForm` component can't skip re-rendering.
<Sandpack>

Loading…
Cancel
Save