When I create CRUD forms in React/Typescript they merge with each-other because the keys of both are the same.
return (
<div className="App d-flex flex-column min-vh-100">
<Route exact path='/' component={HomePage} />
<Route
path={'/(.+)'}
render={() => (
<>
<NavBar />
<Container style={{ marginTop: '7em' }}>
<Route exact path='/subject' component={SubjectDashboard} />
<Route key={location.key} path={['/createSubject', '/manage/:id']} component={CountryForm} />
<Route exact path='/departments' component={DepartmentDashboard} />
<Route key={location.key} path={['/createDepartment', '/manages/:id']} component={DepartmentForm} />
</Container>
</>
)}
/>
I tried location.pathname but still the same problem. this only works if one of them is location.key and the other location.pathname , but when I add the third CRUD form it breaks agian.