0
我收到此錯誤的特性「createRouteFromReactElement」: -
遺漏的類型錯誤:在此代碼不能讀取的不確定
財產「createRouteFromReactElement」。我用路由器進行導航,但沒有工作。我導入一個名爲Home.jsx遺漏的類型錯誤:無法讀取未定義
var React = require('react')
var ReactDOM = require('react-dom')
var Router = require('react-router').Router
var Route= Router.Route
var IndexRoute = Router.IndexRoute
var App = React.createClass({
render() {
return (
<div>
<p>App</p>
<ul>
<li>About</li>
</ul>
</div>
)
}
})
var About = require('./components/Home')
ReactDOM.render((
<Router>
<Route path="/" component={App}>
<IndexRoute path="/about" component={About} />
</Route>
</Router>
), document.body)
和Home.jsx
文件var React = require('react');
var RaisedButton = require('material-ui/lib/raised-button');
var Home = React.createClass({
render:function() {
return (
<RaisedButton label="Default" />
);
},
});
module.exports = Home;