I’m trying to reproduce the “Basic Transition” example from the react-spring website with components imported from a file instead of animated.divs
(https://codesandbox.io/s/cisbc).
However, after replacing the animated.divs with my imported components, the animation isn’t quite working – you can briefly see the background appear between each animation. What am I doing wrong? Here’s the codesandbox link: https://codesandbox.io/p/github/aaronzshey/reactspring-sandbox/main
Turns out, all I needed to do was add position: absolute
to the imported animated element (the Page component in the code). That was it!
1