drei icon indicating copy to clipboard operation
drei copied to clipboard

feat: useMeasure for ScrollHtml

Open nazarenooviedo opened this issue 4 years ago • 3 comments

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!

nazarenooviedo avatar Mar 10 '22 16:03 nazarenooviedo

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

vercel[bot] avatar Mar 10 '22 16:03 vercel[bot]

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

codesandbox-ci[bot] avatar Mar 10 '22 16:03 codesandbox-ci[bot]

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 ... (?)

drcmda avatar Mar 28 '22 22:03 drcmda