Hello everyone! I want to share a small but useful tip for those working with React.js and GSAP.
Many of us face strange layout issues while animating elements. One common error is when a child element seems to “stick” to its parent unexpectedly during animation.
👉 The fix is surprisingly simple: just add a small padding on the parent, for example py-1.
This tiny adjustment prevents the child from sticking and allows GSAP animations to run smoothly.
By adding py-1, the spacing resolves the overlap issue and your animation works as expected.
So next time you see your child element glued to the parent while animating, remember this quick fix
Top comments (0)