I want to do this kind of routing: localhost:3000/function/page where function tells the app which function should take care of this url, and page tells which part we are inside a specific function.
const App: React.FC = () => {
return (
<Router>
<div className="App">
<Route component={SignUp} path="/signup/:page" />
</div>
</Router>
);
}
interface MatchProps extends RouteComponentProps<any> {
page: string;
}
class SignUp extends React.Component<MatchProps> {
public render(){
console.log(this.props.page)
}
}
Then I access this page via localhost:3000/signup/1, in console I can only get an undefined result.