react-three-next
react-three-next copied to clipboard
How to use ScrollControls
The DOM is outside the Canvas so I can't wrap it in ScrollControls. I'm not sure how to handle scrolling for the canvas and DOM otherwise? Do I just pass a scroll progress value to the canvas and update the camera as I scroll through the page?
Any thoughts whatsover? I'm curious to know if this is a valid question
You don't have to use DOM elements outside the Canvas. Just use ScrollControls with <Scroll html>…</Scroll>
Oh it's that simple huh- I thought you HAVE to use it outside or else something won't work as good.
Edit - This works for now I guess, still dunno if it's the best way to do things?. Thanks for the reply! <3
Yeah there are different ways of displaying text inside the scene. There is Troika, drei/Html, drei/ScrollControls, and of course the good old png.
Is it better to import and use ScrollControls in the _app.jsx, page.js or the canvas/component.jsx itself?