Answer the question
In order to leave comments, you need to log in
How to get rid of import error in React-admin "'useHistory' is not exported from 'react-router'"?
When I try to run the project, I get an import error:
"Failed to compile.
./node_modules/ra-core/esm/auth/useLogoutIfAccessDenied.js
Attempted import error: 'useHistory' is not exported from 'react-router'."
I don't explicitly use "useLogoutIfAccessDenied.js" in the project at all.
Tried reinstalling 'react-router' versions to the latest one, 5.3.0, 5.2.1.
How to get rid of this error?
Answer the question
In order to leave comments, you need to log in
useHistory was removed in version 6. Apparently some package remained in version 6 (react-router or react-router-dom)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question