I am trying to use the react-router but when I write a simple route doesn't work and the console show Uncaught TypeError: Cannot read property 'toUpperCase' of undefined.
Otherwise when I use without the react-router that work well
var React = require('react');
var ReactRouter = require('react-router');
var Router = ReactRouter.Router;
var Route = ReactRouter.Route;
var App = React.createClass({
render: function () {
return (
<div>Hello World</div>
);
}
});
React.render((
<Router>
<Route path="/" component={App} />
</Router>
), document.body);
The error is from this line of the react library
function autoGenerateWrapperClass(type) {
return ReactClass.createClass({
tagName: type.toUpperCase(), //<----
render: function() {
return new ReactElement(
type,
null,
null,
null,
null,
this.props
);
}
});
}