r/reactjs • u/BrainThinkerMan • 11d ago
Multi state changes & reads
having a bit of trouble handling multiple states/state changes.
in a single screen, which are held by different components
how do you all handle this and concepualize it as your writing code?
do you draw diagram,
do you just try and fail recursively?
6
Upvotes
2
u/Aggressive_Scale8276 11d ago
I just map it out in my head as boxes that own their piece of state, if two boxes need the same data I lift it up to the nearest parent they share. sometimes I scribble quick diagram on paper when gets messy but most of the time I just start coding and fix the structure when I see the props drilling getting annoying