Closed joshuaedo closed 1 year ago
Hello @joshuaedo thanks for the detailed explanation.
first, what is the version of Lenis you're using?
also, have you checked react-lenis?
one more thing, can you share the component?
last, as i was reviewing the structure, i see you are closing a context provider </HeaderProvider>
but i don't see where that is opened, same for the component.
"@studio-freight/lenis": "^1.0.16",
import { createContext, useState } from "react";
export const HeaderContext = createContext();
export function HeaderProvider({ children }) {
const [isActive, setIsActive] = useState(false);
const [show, handleShow] = useState(false);
return (
<HeaderContext.Provider value={{ isActive, setIsActive, show, handleShow }}>
{children}
</HeaderContext.Provider>
);
}
</HeaderProvider>
.</HeaderProvider>
.last, as i was reviewing the structure, i see you are closing a context provider but i don't see where that is opened, same for the component.
I made mistake while copy-pasting in the original comment.
Here's the full file
import { useState } from "react";
import Header from "./components/header";
import { BrowserRouter } from "react-router-dom";
import Cursor from "./components/cursor/Cursor.jsx";
import Footer from "./components/footer/Footer.jsx";
import Navbar from "./components/navbar/Navbar.jsx";
import { Router } from "./components/router/Router.jsx";
import { HomeLoader } from "./components/loader/Loading.jsx";
import { HeaderProvider } from "./contexts/HeaderContext.jsx";
import MobileNavbar from "./components/mobile-navbar/MobileNavbar.jsx";
import { ScrollToTop } from "./components/smooth-scroll/ScrollToTop.jsx";
// import LenisScroller from "./components/smooth-scroll/LenisScroller.jsx";
// import LocomotiveScroller from "./components/smooth-scroll/LocomotiveScroller.jsx";
export function App() {
const [loading, setLoading] = useState(true);
{
setTimeout(() => {
setLoading(false);
}, 4900);
}
return (
<BrowserRouter>
<div className="bg-black tracking-wider text-white">
{loading ? (
<>
<HomeLoader />
</>
) : (
<>
<HeaderProvider>
{/* <LenisScroller> */}
{/* <LocomotiveScroller> */}
<ScrollToTop>
<Header />
<Navbar />
<MobileNavbar />
<Cursor />
<Router />
<Footer />
</ScrollToTop>
{/* </LocomotiveScroller> */}
{/* </LenisScroller> */}
</HeaderProvider>
</>
)}
</div>
</BrowserRouter>
);
}
I've cloned your repo locally and tested using react-lenis and it's working fine, can you please provide more information like the browser you're using and screen resolution?
steps i did to test:
npm i @studio-freight/react-lenis
then in App.jsx i added:
import { ReactLenis } from "@studio-freight/react-lenis"
return (
<BrowserRouter>
<div className="bg-black tracking-wider text-white">
{loading ? (
<>
<HomeLoader />
</>
) : (
<>
[...]
<ReactLenis root>
<HeaderProvider>
[...]
</HeaderProvider>
</ReactLenis>
[...]
</>
)}
</div>
</BrowserRouter>
);
}
@arzafran any luck?
@joshuaedo provide a codesandbox
i'm closing this issue because lack of activity
Hello,
I have a similar issue as #184.
I am currently building with Vite + React and would love to be able to integrate lenis-smoothscroll into it but I noticed a bug that affects scrolling all the way down on desktop.
When a user scrolls from top to bottom on any two pages, the footer is cut in half on the third page. The order of navigation is irrelevent as the result is always the same.
main.css
... html.lenis { height: auto; } .lenis.lenis-smooth { scroll-behavior: auto; } .lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; } .lenis.lenis-stopped { overflow: hidden; } .lenis.lenis-scrolling iframe { pointer-events: none; }
LenisScroller.jsx
App.jsx