Use History in redux actions
SimoNonnis opened this issue · 2 comments
SimoNonnis commented
Nantris commented
What's your environment that document
is not defined? You can try memory-history
petrloukota commented
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