|
Download react-use/docs/useIsomorphicLayoutEffect.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useIsomorphicLayoutEffect.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/docs/useIsomorphicLayoutEffect.md
-
curl -L -o useIsomorphicLayoutEffect.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useIsomorphicLayoutEffect.md
542 Bytes
| # `useIsomorphicLayoutEffect` | |
| `useLayoutEffect` that does not show warning when server-side rendering, see [Alex Reardon's article](https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a) for more info. | |
| ## Usage | |
| ```jsx | |
| import {useIsomorphicLayoutEffect} from 'react-use'; | |
| const Demo = ({value}) => { | |
| useIsomorphicLayoutEffect(() => { | |
| window.console.log(value) | |
| }, [value]); | |
| return null; | |
| }; | |
| ``` | |
| ## Reference | |
| ```ts | |
| useIsomorphicLayoutEffect(effect: EffectCallback, deps?: ReadonlyArray<any> | undefined); | |
| ``` | |