I'm trying to use the route Route component but it's throwing the following error:
[ts] Type '{ path: "/:shortname"; component: typeof FirstComponent; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Rea...'.
Here's my route config:
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
<Router>
<Link to='/customer'></Link>
<Route path='/:shortname' component={FirstComponent} />
</Router>
These are the versions I'm using:
"@types/react-router-dom": "^4.0.5"
"react-router-dom": "^4.1.1"
FirstComponent
component? It's clear that the error is the interface between react-router and that component, so we may need to see that code to determine the true root cause. – casieber