Jump to content
Search Community

Is it good to just ignore warnings, or is it better to fix them?

samlinck test
Moderator Tag

Recommended Posts

I have page transitions with barba.js and a certain element is not always on the page to be animated. So gsap gives a warning that the target is not found. Can I just disable warnings in my production env. Or is there a good way to not let a certain part of the animation timeline play, when the target isn't found? 

Link to comment
Share on other sites

  • samlinck changed the title to Is it good to just ignore warnings, or is it better to fix them?
if(element){
 tl.to(element, {
   rotate: 90,
 }, 3)
}

Always better to fix warnings if you can.  You could maybe add that particular tween to the timeline if  it exists?

You can also adjust the config like so -
 

gsap.config({ nullTargetWarn: false });

more info

  • Like 4
  • Thanks 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...