Skip to content

Commit

Permalink
[18] Add docs for useInsertionEffect (#4486)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Mar 29, 2022
1 parent 87f1916 commit dcb74b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/docs/hooks-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ const selectedField = useSyncExternalStore(
useInsertionEffect(didUpdate);
```

TODO: description
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.

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

0 comments on commit dcb74b3

Please sign in to comment.