I am not a reaction expert. My problem statement is
- I have a main component that renders multiple subcomponents in sequence to achieve specific functions
- Now, when I save the main component, I also want to save the child component's information.
What is the correct way to handle this problem?
- Use callbacks in subcomponents that return subcomponent status?
- redux store/ useContext hook?
Anything else?
It would be great if I could get some advice. Thanks in advance
Usually this is done via "raise state" , so one solution is to manage all the state in the main component (including child component state) and in the props and functions that trigger the save Pass status.
This general concept can also be applied to "grouping" state into some meaningful objects in a redux store or reactive context.
Some related questions: