Could not find a declaration file for module '@studio-freight/react-lenis'
piscopancer opened this issue · 7 comments
Just bumped on the same issue too
it should be fixed with version 0.0.24
@piscopancer is it fixed ?
You pushed an update ok got it, when I am back home I am gonna check it out ⚡
@clementroche it is not typed at all whadteee...
/**
* @param {boolean=} [root] Whether Lenis will be initialized on document.documentElement
* @param {Object=} [options={}] Lenis options
* @param {boolean=} [autoRaf=true] Whether to call Lenis.raf automatically on every frame
* @param {number=} [rafPriority=0] Priority of Lenis.raf call (lower priority callbacks are called first)
*/
export const ReactLenis: any; // 😭
can you get types from normal lenis and push them to this react version? that would be ease, must be easy, idk. 😎
currently I am using this component (messy af) but it is properly typed hell yeah 🔥
'use client'
import Lenis from '@studio-freight/lenis'
import { useEffect } from 'react'
export default function LenisScroll() {
useEffect(() => {
const lenis = new Lenis({
duration: 2.5,
})
function raf(time: number) {
lenis.raf(time)
requestAnimationFrame(raf)
}
requestAnimationFrame(raf)
})
return <script about='lenis' />
}
Is it still throwing errors ?
If not, i did it right, we don't use Typescript and we don't want to. So we just provide the bare minimum to make it work with TS. However feel free to do a PR if you find a solution for properly providing the types.
Can I close this issue if your initial error was fixed ?
Is it still throwing errors ? If not, i did it right, we don't use Typescript and we don't want to. So we just provide the bare minimum to make it work with TS. However feel free to do a PR if you find a solution for properly providing the types.
Can I close this issue if your initial error was fixed ?
come on, why are you not using ts. that's 2023. anyway, yes close this issue