This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRef } from 'react' | |
/** | |
* This could also be called `useDerived`. Works like useMemo, | |
* except it guarantees that it only executes once per change of dependency values, | |
* which is what `useMemo` is often expected to do, but doesn't guarantee, and doesn't | |
* do in strict mode. | |
* | |
* Differs from `useEffect` in that the value is computed synchronously during render | |
*/ |
OlderNewer