How can I utilize an enum
for the path
property in React Router with TypeScript?
enum paths = "page-1" | "page-2"
interface Props extends RouteComponentProps<MatchParameters> {}
const Application = () => {
return (
<Switch>
<Route path="/page-1">
<PageOne />
</Route>
<Route path="/page-2">
<PageTwo />
</Route>
</Switch>
)