I'm trying new react-router 1.0.0 and I'm getting strange warnings I can't explain:
Warning: Failed propType: Invalid prop `component` supplied to `Route`.
Warning: Invalid undefined `component` supplied to `Route`.
The app is simple:
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route } from 'react-router';
import App from './components/app';
var Speaker = require('./components/speaker');
ReactDOM.render((
<Router>
<Route path="/" component={App}>
// This is the source of the warning:
<Route path="speaker" component={ Speaker }/>
</Route>
</Router>
), document.getElementById('react-container'));
speaker.jsx:
import React from 'react';
var Speaker = React.createClass({
render() {
return (
<h1>Speaker</h1>
)
}
});
module.exoprts = Speaker;
app.jsx only has the following render() function:
render() {
return (
<div>
<Header title={this.state.title} status={this.state.status} />
{this.props.children}
</div>);
}
When I type in the route to #/speaker or #speaker - nothing is displayed except for title. Please help.
module.exoprts
? Also why are you mixing ES6 with ES5? Use imports everywhere instead of doingrequire