i am a react newbie, and every routing example i have found routes to components defined as const, but when using a component class with react router v4 the following error is thrown:
"TypeError: Cannot read property 'apply' of undefined at new About (wuwemek.js:34:70) ..."
in the following example, routing to {Home} works fine, but routing to {About} throws the above error. relevant code below - please let me know if you need to see more:
var { BrowserRouter, Route, Link } = ReactRouterDOM;
const Home = () => <p>home</p>
class About extends React.Component {
render() {
return (<div>about</div>)
}
}
<Link to="/">home</Link>
<Link to="/about">about</Link>
<Route exact path="/" component={Home}/>
<Route path="/about" component={About}/>