sagexiang Posted June 15, 2023 Share Posted June 15, 2023 The latest version of GSAP is not 【gsap.registerPlugin(ScrollTrigger)】, but it still works normally, so I want to know: is 【gsap.registerPlugin(ScrollTrigger)】 necessary? Link to comment Share on other sites More sharing options...
sagexiang Posted June 15, 2023 Author Share Posted June 15, 2023 GSAP Version 3.12.1 Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted June 15, 2023 Solution Share Posted June 15, 2023 Please read https://greensock.com/docs/v3/GSAP/gsap.registerPlugin() 1 Link to comment Share on other sites More sharing options...
sagexiang Posted June 15, 2023 Author Share Posted June 15, 2023 7 hours ago, mvaneijgen said: Please read https://greensock.com/docs/v3/GSAP/gsap.registerPlugin() Do I need to register the plug-in if I only use GSAP on the PC browser and Mobile browser? Link to comment Share on other sites More sharing options...
Rodrigo Posted June 15, 2023 Share Posted June 15, 2023 Hi, Even if your code is working as expected, we strongly recommend registering the plugins that you'll be using in order to prevent unexpected results and Tree Shaking from build tools (webpack, Vite, etc.). Registering the plugins is something that doesn't require any logic whatsoever (just execute a method) and has great upside going forward, especially when it becomes a habit. This is the the healthy habit type If you keep having questions about this, please create a minimal demo or provide a better description of the scenario you have. Happy Tweening! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now