The router looks somthing like this
import { BrowserRouter, Route, Switch } from 'react-router-dom';
...
<Route exact path='/confirm-email/:confirmationCode' component={ConfirmEmail} />
^
// This is the value that gets passed to the props
And the component that gets loaded is
import { RouteComponentProps } from 'react-router-dom';
interface PropsInterface extends RouteComponentProps<{}> {
confirmationCode: string;
}
const ConfirmEmail: React.FC<PropsInterface> = (props: PropsInterface) => {
const confirmationCode = props.match.params.confirmationCode;
^
// Error Here!
The error I get is Property 'confirmationCode' does not exist on type '{}'.ts(2339)
This is not a duplicate of react-router-dom with TypeScript as it does not address the dynamic path being passed as a prop