14islands / r3f-scroll-rig

A react-three-fiber scroll-rig for syncing 3D meshes and DOM elements.
MIT License
721 stars 36 forks source link

Export useWindowSize hook #47

Open rodleviton opened 2 weeks ago

rodleviton commented 2 weeks ago

Hi, thank you for the great library! It would be really helpful if you could export src/hooks/useWindowSize.ts, as it seems like a useful utility. Specifically, I’m looking for a performant way to get the current window dimensions outside of a scroll context. Is there a particular reason why this hasn’t been exported along with the other utilities?

Cheers

ffdead commented 1 day ago

Hi @rodleviton - sure we could expose it!

I believe we never had to use it since usually we get the viewport size from useThree or framer-motion when we work on projects :)