Skip to content

Commit dcb74b3

Browse files
committed
[18] Add docs for useInsertionEffect (#4486)
1 parent 87f1916 commit dcb74b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/docs/hooks-reference.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ const selectedField = useSyncExternalStore(
599599
useInsertionEffect(didUpdate);
600600
```
601601

602-
TODO: description
602+
The signature is identical to `useEffect`, but it fires synchronously _before_ all DOM mutations. Use this to inject styles into the DOM before reading layout in [`useLayoutEffect`](#uselayouteffect). Since this hook is limited in scope, this hook does not have access to refs and cannot schedule updates.
603603

604604
> Note:
605-
>
606-
> TODO: no refs
605+
>
606+
> `useInsertionEffect` should be limited to css-in-js library authors. Prefer [`useEffect`](#useeffect) or [`useLayoutEffect`](#uselayouteffect) instead.

0 commit comments

Comments
 (0)