I'm using react-router v3.2.0 and this is my app.js, error is showing on line router: PropTypes.object in chrome and in edge it shows error as TypeError: Unable to get property 'object' of undefined or null reference at class App extends React.Component , btw I am new to react
import React, { PropTypes } from 'react';
import { Router } from 'react-router';
import './App.css';
class App extends React.Component {
static contextTypes = {
router: PropTypes.object
}
static propTypes = {
history: PropTypes.object.isRequired,
routes: PropTypes.element.isRequired
};
get content() {
return (
<Router
routes={this.props.routes}
history={this.props.history} />
)
}
render () {
return (
<div className="App">
<div style={{ height: '100%' }}>
<h2>Welcome to Vavavoom!</h2>
{this.content}
</div>
</div>
)
}
}
export default App;