我一直在关注Tyler Mcginnis的教程,并对反应路由器,尤其是历史记录表示不满.我最后逐字复制他的代码只是为了看看它是否只有我,但我还是得到了
Warning: React.createElement: 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.
Warning: Failed prop type: The prop `history` is marked as required in
`Router`, but its value is `undefined`. in Router
Uncaught TypeError: Cannot read property 'location' of undefined
at new Router (index_bundle.js:8347)
at index_bundle.js:19079
at measureLifeCyclePerf (index_bundle.js:18859)
at ReactCompositeComponentWrapper._constructComponentWithoutOwner (index_bundle.js:19078)
at ReactCompositeComponentWrapper._constructComponent (index_bundle.js:19064) …Run Code Online (Sandbox Code Playgroud)