Skip to content

Commit 28fc22b

Browse files
committed
Update docs
1 parent d4e23fc commit 28fc22b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contributingGuides/STYLE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ The short answer is no. A longer answer is that sometimes we need to check not o
642642
643643
## Are `useCallback()` and `useMemo()` basically the same thing?
644644
645-
No! Is it easy to confuse `useCallback()` with a memoization helper like `_.memoize()` or `useMemo()`. It is really not the same at all. [`useCallback()` will return a cached function _definition_](https://react.dev/reference/react/useCallback) and will not save us any computational cost of running that function. So, if you are wrapping something in a `useCallback()` and then calling it in the render then it is better to use `useMemo()` to cache the actual **result** of calling that function and use it directly in the render.
645+
No! It is easy to confuse `useCallback()` with a memoization helper like `_.memoize()` or `useMemo()` but they are really not the same at all. [`useCallback()` will return a cached function _definition_](https://react.dev/reference/react/useCallback) and will not save us any computational cost of running that function. So, if you are wrapping something in a `useCallback()` and then calling it in the render then it is better to use `useMemo()` to cache the actual **result** of calling that function and use it directly in the render.
646646
647647
## What is the `exhaustive-deps` lint rule? Can I ignore it?
648648

0 commit comments

Comments
 (0)