Closed abirtasrif closed 1 year ago
This seems to be a common issue from create-react-app
Sources:
-https://github.com/framer/motion/issues/1307
-https://github.com/facebook/create-react-app/issues/10356
You can look for solution on those threads, one from Framer suggests to use create-react-app@next
@abirtasrif
Hello, I've had similar issue in Vue/Nuxt - solved thanks to this solution: https://github.com/vuejs/pinia/issues/675#issuecomment-945602370
Maybe it can help your case too.
@abirtasrif any news, is it fixed ?
@abirtasrif any news, is it fixed ?
@clementroche No, but I've used the previous version of lenis which working fine.
@abirtasrif Can you try again with v1.0.0-dev.5 ?
@clementroche lenis 0.2.28 is working fine.
Description Though its working perfectly with version 0.2.21 . My dev-server returning below error with version 0.2.26 -
./node_modules/@studio-freight/lenis/dist/lenis.mjs
Can't import the named export 'TinyEmitter' from non EcmaScript module (only default export is available)
Below is the hook code that used-
import { useEffect } from "react";
import Lenis from "@studio-freight/lenis";
export const useSmoothScroll = () =>
const lenis = new Lenis({
duration: 1.5,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
direction: "vertical",
smooth: true,
});
useEffect(() => {
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
}, []);
};