React.createElement: type is invalid — expected a string, but got: object

旧时模样 提交于 2019-12-05 08:02:05

Which version of React Router are you using? I was also getting the Warning: React.createElement error in the console, but switching from version 3.0.2 to the 4.0.0-alpha.6 pre-release got rid of it for me.

Please have a look at how the components are exported which you are trying to import in the current component(you can identify the current component by looking into the stacktrace that indicates an approximate location of where the failure occurs).

i have faced a same issue while importing a component which was exported with "default" keyword. since the same component was being imported in many other components, react parser was giving this error. after changing this component from "export default" to named export(i'e, without "default" keyword), i never saw this error again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!