尝试让最基本的路由工作
var Router = ReactRouter;
var DefaultRoute = Router.DefaultRoute;
var Link = Router.Link;
var Route = Router.Route;
var RouteHandler = Router.RouteHandler;
var Hello = React.createClass({
render: function() {
return <div>
<h1> Hello at {this.props.now} </h1>
<RouteHandler />
</div>
}
});
ReactDOM.render(<Hello now = { new Date().toString()} />,
document.getElementById('outer-container'));
var routes = (
<Route name="app" path="/" handler={Hello}>
</Route>
);
Router.run(routes, function(Handler) {
React.render(<Handler />, document.getElementById('outer-container'));
});
但是我收到以下错误
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of `Hello`.
我缺少什么