useLayoutEffect
that does not show warning when server-side rendering, see Alex Reardon's article for more info.
import React from 'react';
import { useIsomorphicLayoutEffect } from 'react-essential-tools';
const Demo = ({ value }) => {
useIsomorphicLayoutEffect(() => {
window.console.log(value)
}, [value]);
return null;
};