Open alinoob opened 1 year ago
@alinoob I also think type definitions would be helpful! You may have already found a workaround, but I wanted to include one I found here too for future people looking to use this repo.
I found this workaround from this article. Basically, create a decs.d.ts
file and the line declare module "react-scrollama"
. Then, you just have to make sure the include
field in your tsconfig.json
will pick up decs.d.ts
.
I'm still pretty new to working with TypeScript, so there may be better workarounds, but this did the trick for me!
I actually switched to the gsap library which is pretty neat aswell. But thanks for your reply.
I actually switched to the gsap library which is pretty neat aswell. But thanks for your reply.
Is gsap doing the same doing scrollama?
I dont think so. I just read https://gsap.com/docs/v3/Plugins/ScrollTrigger/#how-does-scrolltrigger-work-is-it-just-like-intersectionobserver
React Scrollama is pretty simple, it's just a wrapper around IntersectionObserver, and it's meant to serve use cases that aren't that complex (e.g. a simple scrollytelling article). GSAP seems to be doing much more complex stuff, and also uses (debounced) scroll events rather than IntersectionObserver. And it seems to be used for fairly involved interactions/animations.
but sometimes in scrollama with intersection Observer does not detect all steps successfully when scrolling fast or when there are complex state changes.
Would it be possible to publish types for TypeScript?