useLayoutEffect
that does not show warning when server-side rendering, see Alex Reardon's article for more info.
import {useIsomorphicLayoutEffect} from 'react-use';
const Demo = ({value}) => {
useIsomorphicLayoutEffect(() => {
window.console.log(value)
}, [value]);
return null;
};
useIsomorphicLayoutEffect(effect: EffectCallback, deps?: ReadonlyArray<any> | undefined);