Skip to content
Advertisement

Tag: react-redux

Redux loses state when navigating to another page

I am building a web application using React and Redux. Redux works when I set the state on that page and then reaccess it through a statement like this.props.book.bookTitle, however, when I navigate to another page, redux loses it’s state and defaults to the initialState. Here is my code: bookDuck.js: reducer.js: store.js: index.js: In the following piece of code, I

How to dispatch a Redux action with a timeout?

I have an action that updates the notification state of my application. Usually, this notification will be an error or info of some sort. I need to then dispatch another action after 5 seconds that will return the notification state to the initial one, so no notification. The main reason behind this is to provide functionality where notifications disappear automatically

Advertisement