when I first to use react-router, but page gives me this error below
React-router: type.toUpperCase is not a function
var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var App = React.createClass({
render: function() {
return (
<div>App</div>
);
}
});
React.render((
<Router>
<Route path="/" component={App} />
</Router>
), document.getElementById('app'));
it seems nothing wrong from the document, some one could help me?
where error comes here
function autoGenerateWrapperClass(type) {
return ReactClass.createClass({
tagName: type.toUpperCase(),
render: function() {
return new ReactElement(
type,
null,
null,
null,
null,
this.props
);
}
});
}
change the require statements: