Skip to content

Commit eccd2a1

Browse files
authored
Update docs/src/pages/use-component-will-receive-update.mdx
1 parent 11f6ba6 commit eccd2a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/src/pages/use-component-will-receive-update.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ You may also want to read [(Avoid) Notifying parent components about state chang
5454
If you need to edit other components' states, write it like this:
5555

5656
```js
57+
import { flushSync } from 'react-dom'
58+
5759
useComponentWillReceiveUpdate(() => {
5860
// Force React to immediately flush scheduled/batched updates
5961
flushSync(() => setLocalState(false))

0 commit comments

Comments
 (0)