introduced React-redux, into RN, but now a problem has been found:
after I enter a screen and do some operations, the corresponding state of the screen changes, exits and enters again. Since the state in store has not been reset, the state after the last operation is still there (for example, a prompt or picture that should not be displayed in the initial state)
how to solve this problem? How can I show the initial state of the screen every time I enter the screen?
see someone say that the action that resets the state is sent in the component"s life cycle function: componentWillUnmount.
this does solve the problem, but is there a more elegant way? This practice is fine when the number of pages is small, but if there are a large number of pages, it really doesn"t feel like a good idea. And a lot of Action has been added out of thin air.
is there any middleware or plug-in in the redux family bucket that can solve this problem?