New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot read property 'createRouteFromReactElement' of undefined #1799
Comments
Finally solved. Just had to replace <DefaultRoute component={Home} /> with: <Route path="/" component={Home} /> |
You can also use <IndexRoute component={Home} /> See the IndexRoute docs for the motivation. |
Hey All, I know this issue is closed, but this is the closest i've found to the issue i'm running into.
but still getting the error. I'm using |
Thanks for your question! We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router. Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router. We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46. |
Thanks for the info, will do. |
@jwright04 if you asked this on SO, do you have a link to the question? Because this issue is the top hit on google for "TypeError: Cannot read property 'createRouteFromReactElement' of undefined" still, and being able to follow the link trail to a solution is infinitely better than mining google results =) |
probably have your imports wrong |
|
changing the import syntax worked for me
works:
|
I had the same issue. Ryan was right, I had my imports wrong. This may help anyone that hasn't upgraded to es6:
|
@seanbrookes if you're using ES6 imports, you can simply use
Because you don't need the |
I know this is closed, have the exact same issue, but it isn't the path that's the problem. Can I see an example of how one of your components are structured? @dlwalsh |
I get the following error using v1.0.0-beta4:
Uncaught TypeError: Cannot read property 'createRouteFromReactElement' of undefined
.I also get this warning:
Warning: React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components).
I don't know what either message means. I've spent hours on this but for the life of me I can't figure out what I'm doing wrong. The source code is below.
The text was updated successfully, but these errors were encountered: