mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Update 2018-06-07-you-probably-dont-need-derived-state.md (#1059)
A single form of `arguments` confused me here
This commit is contained in:
committed by
Dan Abramov
parent
e52e6c6d5a
commit
9db176ea1c
@@ -337,7 +337,7 @@ This is much simpler and performs just as well as the derived state version!
|
||||
When using memoization, remember a couple of constraints:
|
||||
|
||||
1. In most cases, you'll want to **attach the memoized function to a component instance**. This prevents multiple instances of a component from resetting each other's memoized keys.
|
||||
1. Typically you'll want to use a memoization helper with a **limited cache size** in order to prevent memory leaks over time. (In the example above, we used `memoize-one` because it only caches the most recent argument and result.)
|
||||
1. Typically you'll want to use a memoization helper with a **limited cache size** in order to prevent memory leaks over time. (In the example above, we used `memoize-one` because it only caches the most recent arguments and result.)
|
||||
1. None of the implementations shown in this section will work if `props.list` is recreated each time the parent component renders. But in most cases, this setup is appropriate.
|
||||
|
||||
## In closing
|
||||
|
||||
Reference in New Issue
Block a user