Installing react-router-dom-v5-compat installs react-router-dom v6 (and causes type errors) #9448
-
I installed react-router-dom-v5-compat and was immediately hit with a mountain of errors from typescript. "location" does not exist But I have v5 installed and only installed react-router-dom-v5-compat. Is there something I need to do with my package lock or tsconfig to make sure it is using v5 types even though v6 is a dependency of react-router-dom-v5-compat? Thanks! package.json for good measure (shortened):
and an actual error:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Anyone who stumbles here, just delete node_modules and package-lock and reinstall. This fixed for me! |
Beta Was this translation helpful? Give feedback.
-
A better solution might be to add |
Beta Was this translation helpful? Give feedback.
Anyone who stumbles here, just delete node_modules and package-lock and reinstall. This fixed for me!