0

I have the next situation,

I build a react native app, using design patter: Container-Presentational.

Focus on the problem: When I update props, in component A, I need that the B component change too, when I switch the screen to this B component, I need B component re-render with this new props.

You need to know I am using redux to storage the props, and this component shared navigation.

The main problem is that I cant found one life cycle method where I can re-render component with this new props because the component was rendered, I can´t join in anyone life cycle method.

I can't share the code I'm sorry, but the idea is this:

Having component A and B and these depend on a that depending on their value will show one thing or another.

Example: When I change the value of the picker in component B and then I go to component A, the value of the picker is still maintained. but the information that should be displayed in component A is still the one that corresponds to the previous value in the picker and not to the current value.

Until now I have been able to solve it in the following way but I don't know if it is the optimal one. inside the onValueChange of the picker, where I do the ditpatch to update the data of the component itself, I also do the ditpach of the other component.

0 Answers0