Open SimoNonnis opened 2 years ago
What's your environment that document
is not defined? You can try memory-history
Use HistoryRouter instead of BrowserRouter:
import { unstable_HistoryRouter as HistoryRouter } from 'react-router-dom';
Then, you will be able to import history global object in redux thunk actions.
import history from 'history/browser'; // use history in thunk actions
I am in the process to upgrade to
rect-router-6
and getting rid ofbrowserHistory
inside my redux/actions
folder. I am trying to usehistory
using both ways presented here:but I get an error anyway:
Using own history instance:
Importing browser history singleton:
Does anyone know if I am doing something wrong?