Skip to content

Commit 6671ba7

Browse files
OliverJAsheps1lon
andauthored
Document behaviour of setting state inside useLayoutEffect (#7096)
Co-authored-by: Sebastian Silbermann <[email protected]>
1 parent 6274d4f commit 6671ba7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/content/reference/react/useLayoutEffect.md

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function Tooltip() {
6767
6868
* The code inside `useLayoutEffect` and all state updates scheduled from it **block the browser from repainting the screen.** When used excessively, this makes your app slow. When possible, prefer [`useEffect`.](/reference/react/useEffect)
6969
70+
* If you trigger a state update inside `useLayoutEffect`, React will execute all remaining Effects immediately including `useEffect`.
71+
7072
---
7173
7274
## Usage {/*usage*/}

0 commit comments

Comments
 (0)