I need help. How to implement history property to use it as a global prop and also in hole project(also in file with .ts extensions).
I need (history.push method) inside .ts (not functional components .tsx) file to redirect to the home page.
you can see images and the problem whit the history prop when I tried to pass inside Router. enter image description here
You've the latest version of history
installed but you've the previous version of react-router-dom
. react-router-dom@5
uses history@4
.
npm un -s history
npm i -s history@4