ts-error-translator
ts-error-translator copied to clipboard
Translation request for 2717
Error Text
Subsequent property declarations must have the same type. Property 'path' must be of type 'string | undefined', but here has type 'AllPath | undefined'.
Supporting Information
Please provide other information which led to this error, and any specific questions you have about it:
I try to overwrite the path
prop of the <Route />
component of react-router-dom
to make it type safe. Normally, it's only a string. but this is not so nice as DX. I tried this approach, but this results in the error message above.
declare module 'react-router-dom' {
interface PathRouteProps {
path?: AllPath;
}
interface IndexRouteProps {
path?: AllPath;
}
}