feat: useMeasure for ScrollHtml
Why
I needed to be able to resize the browser and keep the HTML height dynamically
What
I used a hook useMeasure to get the height, and I replaced the static page number with the bounds got by the hook.
Checklist
- [X] Ready to be merged
I'm open to receiving other approaches, comments, to polish it!
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/pmndrs/drei/9SowG9nRqHuUbvWuaXU8P9VLhmSL
✅ Preview: https://drei-git-fork-nazarenooviedo-noviedo-scroll-contr-ed7fe8-pmndrs.vercel.app
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 7a18ac605c3a6b95f454b5d1e4cf7b48cf1440bc:
| Sandbox | Source |
|---|---|
| youthful-euler-prst9m | Configuration |
| Ground reflections and video textures | Configuration |
| arc-x-pmndrs-colors | Configuration |
what i do not understand is what usemeasure is supposed to do here, useThree size.width/height will tell us the actual pixel size of the canvas and that already has been measured through use-measure ... (?)