search

Home  >  Q&A  >  body text

Managing state when using multiple subcomponents

I am not a reaction expert. My problem statement is

What is the correct way to handle this problem?

  1. Use callbacks in subcomponents that return subcomponent status?
  2. redux store/ useContext hook? Anything else?

It would be great if I could get some advice. Thanks in advance

P粉032649413P粉032649413445 days ago609

reply all(1)I'll reply

  • P粉493534105

    P粉4935341052023-09-16 00:18:18

    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:

    reply
    0
  • Cancelreply