-
-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ref as content #417
Comments
const contentRef = useRef()
return ( <Lenis ref={(ref)=>{
contentRef.current = ref?.content
}}>
// content
</Lenis> ) |
Hey @clementroche, thanks for the quick response! I understand. My problem is actually a slightly different one, I just thought it’d be fixed by defining the content. In my NextJS I have a root layout that uses
It seems, that the two instances of Lenis interfere with each other and I don’t know how to fix this? |
Defining a content element for a root Lenis is useless and will do nothing. Why can't you define a layout that will take care of switching from vertical to horizontal? And then call it within your page? Your Lenis doesn't need to be defined in the root layout. |
I'm trying to pass a ref as content in my Lenis options:
which obviously doesnt work since ref.current might be null until it’s loaded. How can I set a specific content container in React/NextJS?
The text was updated successfully, but these errors were encountered: