i'm using locomotive scroll with next.js, after react v18 my clean up stage is stopped working... Can someone explain why?
useEffect(() => {
let scroll;
import("locomotive-scroll").then((locomotiveModule) => {
scroll = new locomotiveModule.default({
el: document.querySelector("[data-scroll-container]"),
smooth: true,
});
});
return () => {
scroll.destroy();
}});
I have error "Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'destroy')"
*If I down install react to 17 version all working fine