useDimensions icon indicating copy to clipboard operation
useDimensions copied to clipboard

Support for server side rendering

Open nishanBende opened this issue 5 years ago • 5 comments

We can use a flag named isSSR and use useEffect hook instead of useLayoutEffect. https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85

nishanBende avatar Jan 22 '20 11:01 nishanBende

I second this request! I would like to use this in nextjs.

sorensenjg avatar Feb 05 '20 02:02 sorensenjg

any update on this?

kevinkashou avatar May 04 '20 05:05 kevinkashou

@Swizec I have updated the PR to use typeof window to determine SSR or CSR instead of adding a new flag.

nishanBende avatar May 04 '20 06:05 nishanBende

Any reason why this hasn't been merged yet?

timohermans avatar May 15 '20 13:05 timohermans

Also, I've added a comment to the above PR, as the code isn't entirely correct

timohermans avatar May 15 '20 13:05 timohermans