I'm trying to use redux-router in a project, but I cannot get it to work.
Here is my routes definition (partial) :
export default function(store) {
return (
<Route path="/" component={Main}>
[ALL NESTED ROUTES]
</Route>
)
}
My routes work well with react-router.
And then my init code (partial) :
import ReduxRouter from 'redux-router'
import {Provider} from 'react-redux'
[...]
const routes = Routes(store);
class Root extends Component {
render() {
return (
<div>
<Provider store={store}>
<ReduxRouter>{routes}</ReduxRouter>
</Provider>
</div>
);
}
}
ReactDOM.render(<Root />, document.getElementById('content'));
I get the following error on the ReduxRouter's createElement :
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
I get the following error if I just try to write to console :
<ReduxRouter>{routes}</ReduxRouter>
In the console, I get a Symbol(react.element) with correct props (my routes as children), but with type undefined
As a consequence, I then get :
Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of
Root.
What am I missing ?