g-loot / react-tournament-brackets

React component library for displaying bracket leaderboards
https://sleepy-kare-d8538d.netlify.app/?path=/story/components-bracket--bracket
GNU Lesser General Public License v2.1
219 stars 69 forks source link

better and safer useWindowSize for NextJS #60

Closed zarganum closed 1 year ago

zarganum commented 1 year ago

Dear team,

While the #34 workaround is available, let me attract your attention for a better implementation of useWindowSize() as a part of usehooks-ts package. Despite the same functionality, the useWindowSize() hook I mention demonstrates NextJS-friendly implementation which does not raise any CSR issues and does not require dynamic import wrappers. Mind the returned object instead of tuple though.

PS I understand "workaround" as a quick-fix while permanent solution is being investigated. Well, I guess this is it.

Many thanks

zarganum commented 1 year ago

apparently the useWindowSize() does not seem to impact the CSR issues, need more investigation