I have two class component A and B, i navigate to B by using this.props.navigation.navigate('B') then B component will have a back arrow on headerLeft, when i click the back arrow my data is still using B component data although my screen is A component.
I want to know what is going on when i click the back arrow, i try to console.log in A and B under their render function, i find it will render B > A > B
If i don't click the back arrow button only navigate it by using this.props.navigation.navigate('B or A'), the problem is gone.
My data is come from fetch API with react-redux. I try a simple test to fetch API without react-redux, the problem is gone too.
I have no idea the issue come from react-navigation or react-redux.
Thanks in advance.
Here is my A component file (B component file is similar with A):
What code are you running and what is happening?
Click back arrow on headerLeft in B component to A component , the data is still using B component data.
Expected Behavior
What do you expect should be happening?
Click back arrow on headerLeft in B component to A component , it should render A component only once not B > A > B
I have two class component A and B, i navigate to B by using this.props.navigation.navigate('B') then B component will have a back arrow on headerLeft, when i click the back arrow my data is still using B component data although my screen is A component.
I want to know what is going on when i click the back arrow, i try to console.log in A and B under their render function, i find it will render B > A > B
If i don't click the back arrow button only navigate it by using this.props.navigation.navigate('B or A'), the problem is gone.
My data is come from fetch API with react-redux. I try a simple test to fetch API without react-redux, the problem is gone too.
I have no idea the issue come from react-navigation or react-redux.
Thanks in advance.
Here is my A component file (B component file is similar with A):
Current Behavior
Expected Behavior
Include a screenshot if it makes sense.