mattpocock / ts-error-translator

VSCode extension to turn TypeScript errors into plain English
https://ts-error-translator.vercel.app
2.36k stars 90 forks source link

Translation request for 2717 #247

Open MatchuPitchu opened 8 months ago

MatchuPitchu commented 8 months ago

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;
  }
}