react-transition-group icon indicating copy to clipboard operation
react-transition-group copied to clipboard

Check the render method of `Router.Consumer`

Open h1sashin opened this issue 5 years ago • 1 comments

I get this error every time I try to use react-transition-group with react-router

`× Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of Router.Consumer.`

I get this even when I just copy code from https://reactcommunity.org/react-transition-group/with-react-router so I think it's problem with react-transition-group. Tried using v1, tried using react-tiger-transition, always the same error.

h1sashin avatar Nov 28 '20 10:11 h1sashin

Check the form you are importing. It is necessary to put the BrowserRouter in the import. Look:

import { BrowserRouter as Router, switch, route } from "react-router-dom";

rwmsousa avatar Feb 22 '22 16:02 rwmsousa