Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing Types for TypeScript? #98

Open
alinoob opened this issue Jan 17, 2023 · 5 comments · May be fixed by #106
Open

Providing Types for TypeScript? #98

alinoob opened this issue Jan 17, 2023 · 5 comments · May be fixed by #106

Comments

@alinoob
Copy link

alinoob commented Jan 17, 2023

Would it be possible to publish types for TypeScript?

@chasedawson
Copy link

@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!

@alinoob
Copy link
Author

alinoob commented Jan 27, 2023

I actually switched to the gsap library which is pretty neat aswell. But thanks for your reply.

@0xMohamed
Copy link

I actually switched to the gsap library which is pretty neat aswell. But thanks for your reply.

Is gsap doing the same doing scrollama?

@jsonkao
Copy link
Owner

jsonkao commented Feb 2, 2024

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.

@0xMohamed
Copy link

but sometimes in scrollama with intersection Observer does not detect all steps successfully when scrolling fast or when there are complex state changes.

@condorheroblog condorheroblog linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants