useIsomorphicLayoutEffect

A React Hook that will automatically use React.useLayoutEffect in client side and React.useEffect in server side to avoid the warning of useLayoutEffect in Server-side Rendering (SSR).

Demo

Try to change count and then open DevTools to see the effect.

Source
Count:
0

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

Same as React.useLayoutEffect.

ON THIS PAGE