Questions tagged «react-hot-loader»

26
React.createElement:类型无效-预期为字符串
试图使react-router(v4.0.0)和react-hot-loader(3.0.0-beta.6)正常播放,但是在浏览器控制台中出现以下错误: 警告:React.createElement:类型无效-预期为字符串(对于内置组件)或类/函数(对于复合组件),但得到:未定义。您可能忘记了从定义文件中导出组件。 index.js: import React from 'react'; import ReactDom from 'react-dom'; import routes from './routes.js'; require('jquery'); import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/js/bootstrap.min.js'; import './css/main.css'; const renderApp = (appRoutes) => { ReactDom.render(appRoutes, document.getElementById('root')); }; renderApp( routes() ); route.js: import React from 'react'; import { AppContainer } from 'react-hot-loader'; import { Router, Route, browserHistory, …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.