Browse Source

Fix usage of useDeferredValue (#4520)

main
Sukka 3 years ago
committed by GitHub
parent
commit
69ca55b931
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/docs/hooks-reference.md

2
content/docs/hooks-reference.md

@ -524,7 +524,7 @@ useDebugValue(date, date => date.toDateString());
### `useDeferredValue` {#usedeferredvalue}
```js
const [deferredValue] = useDeferredValue(value);
const deferredValue = useDeferredValue(value);
```
`useDeferredValue` accepts a value and returns a new copy of the value that will defer to more urgent updates. If the current render is the result of an urgent update, like user input, React will return the previous value and then render the new value after the urgent render has completed.

Loading…
Cancel
Save