Jump to content


React Explosion

Go to solution Solved by anthonygreco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi all,


Been working on an explosion component in React and ran across the

See the Pen VjPaLO by jscottsmith (@jscottsmith) on CodePen

on Codepen. Excellent GSAP work there. Then I forked that and tweaked it a bit to what I was aiming for in

See the Pen PGPVJz by anthonygreco (@anthonygreco) on CodePen

. So far, so good. Then I started integrating this with React and found that I had to do things a bit different due to the way React works. After a bit of mucking around I feel like I've got things at least set up right but I'm encountering a peculiar outcome I'm wondering if anyone could assist with. I'm not sure if my issue lies in React, GSAP, or possibly even the layout with CSS.


Here's the

See the Pen ALwYYN by anthonygreco (@anthonygreco) on CodePen

pen I'm working on (the main Codepen URL on this post). It appears as if everything seems to be working aside from the Physics2DPlugin.


Anyone have any thoughts?

See the Pen ALwYYN by anthonygreco (@anthonygreco) on CodePen

  • Thanks 1
Link to comment
Share on other sites

  • Solution

My Hero.  :-P


Turns out I simply wasn't passing the props from the Explosion component to the SpriteContainer component and then further down to the Sprite component. I updated the pen and all appears to be working as expected now.


Thanks Carl!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Glad I could help. Going into it I wasn't so sure ;)

  • 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.