Closed NealWilxite closed 2 years ago
should be able to do easily with a clearAction
as above. can you share a codesandbox?
the wizard is part of the clients site, so it is a little difficult to extract but i'll give it a try.
I think I fixed the issue. Was peppering my code with state updaters that were conflicting with each other.
I am using lsm with react-router for a wizard on a client's site and I need to reset the store when a user returns to the wizard landing page. I found this solution in stack overflow (https://stackoverflow.com/questions/64822032/react-little-state-machine-clear-data) but I cant get it to work. I cant show the full application, but from the below can you see anything wrong with what I have done.
Using
App.js
Steps.js
clearAction.js
I even tried to use window.__LSM_RESET(), sessionStorage.removeItem('LSM__') and sessionStorage.clear(). None of these work.
Is there a simpler way to reset/clear the store from within a component?