A
A
Alexey1122021-11-06 16:56:39
React
Alexey112, 2021-11-06 16:56:39

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

1 answer(s)
H
HealSpirit, 2021-11-06
@HealSpirit

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 question

Ask a Question

731 491 924 answers to any question