Hello! I am trying to animate my components using the motion package but, the exit animations with ExitingPersistence are not working…I have spent a lot of time trying to debug but couldn’t figure out what’s wrong. here is the sandbox
Hey @GHMahimaanvita. This is really interesting. I’m able to get the example working by changing index.js back to the old render syntax:
import React from "react";
import ReactDOM from "react-dom";
import Example from "./App";
ReactDOM.render(<Example />, document.getElementById("root"));
You can see a working sandbox of it here: base (forked) - CodeSandbox (I haven’t changed your App.js at all in my fork)
So, it looks like upgrading to createRoot() syntax is what breaks it. Currently, @atlaskit/motion supports "react": "^16.8.0". So, it’s unlikely that this will get fixed until we start supporting React 18 (which is when createRoot was introduced).
As a workaround, if you’re able to, using the old ReactDOM.render() syntax should work. I believe you’re still able to use this syntax while using React 18.