I am using React Router with React Transition Group to animate between routes. I have a problem when I use a <Redirect />
component. The App works, but I get multiple warnings from React Router that reads:
Warning: You tried to redirect to the same route you're currently on: "/"
You can see it happen in this Code Sandbox. Make sure to open the sandbox console and then enter a bad path (like codesandbox.io/abc).
I tried following the example they give in their docs (https://reacttraining.com/react-router/web/example/animated-transitions), but that does not include a Redirect. Is there a better way to use Redirect and Transitions to avoid the warnings?