Closed bbg closed 3 years ago
There is no react component at "gsap/ScrollTrigger". I think I have to update the documentation to make it clearer. Just import ScrollTrigger from "react-gsap" and you don't have to register the plugin.
So please try the following:
import { Tween, ScrollTrigger } from 'react-gsap';
const Homepage = (): JSX.Element => {
return (
<ScrollTrigger start="-200px center" end="200px center" scrub={0.5} markers>
<Tween
to={{
x: '300px',
}}
>
<div style={{ width: '100px', height: '100px', background: '#ccc' }} />
</Tween>
<Tween
to={{
x: '300px',
}}
>
<div style={{ width: '100px', height: '100px', background: '#999' }} />
</Tween>
</ScrollTrigger>
);
};
Thank you. As you said I did the problem was solved. The document is misleading. Updating is really important.
Hi everyone,
I want to use GSAP in my project with NextJS + Typescript. However, I am getting the error you will see in the screenshot.
My code to import the library;
Error;
Version information;
When I try with NextJS without Typescript, I get the same error.
Important: Uninstalling the react-gsap library resolves the error.
Thanks