Jump to content
Search Community

registerEffect and React

elegantseagulls test
Moderator Tag

Recommended Posts

Does anyone have any experience using registerEffect with React?
I'm trying to create/register my effects in my _app.js file, and use them in a component, but am receiving an error on first load:

 

TypeError: gsap__WEBPACK_IMPORTED_MODULE_12__.default.effects.fadeInEffect is not a function

 

I'm thinking this is happening because my app is trying to use the effect before it's registered (it seems to work just fine after initial load). Is there a way to check if the effect exists? Also, is there a way/need to do garbage cleanup for effects?


I haven't had the chance to spin up a Sandbox yet, but was hoping someone has any suggestions.

Link to comment
Share on other sites

56 minutes ago, elegantseagulls said:

Also, is there a way/need to do garbage cleanup for effects?

 

No. An effect is really just a helper function that selects elements and merges props for you. It doesn't even have to do anything animated related.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...