Search code examples
javascriptreactjsreduxreact-routerflux

Delete redux state on navigating to a different route in react-redux application?


I am writing a react-redux application, that has some 4 routes. I am using react-router to navigate to different routes. My question here is, is it recommended to delete redux state on navigating to a different route?


Solution

  • In general I would not say it is needed to delete existing state when transitioning to another route in the app. If you come back to that part, you can display data faster. You might need to consider if there is a need to refresh that when you come back to it.