useDimensions
useDimensions copied to clipboard
Support for server side rendering
We can use a flag named isSSR and use useEffect hook instead of useLayoutEffect. https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
I second this request! I would like to use this in nextjs.
any update on this?
@Swizec I have updated the PR to use typeof window
to determine SSR or CSR instead of adding a new flag.
Any reason why this hasn't been merged yet?
Also, I've added a comment to the above PR, as the code isn't entirely correct