Answer the question
In order to leave comments, you need to log in
Is this approach of rendering through setState normal?
And so let's say I have 4 components:
<App />
<Desks />
<Desk />
<DeskHead />
<App />
is responsible for rendering <Desks />
, <Desks />
in turn, is responsible for rendering <Desk />
, and <Desk />
for <DeskHead />
<DeskHead />
I send some values to the <App />
component through parents on click to call the setState method and update some kind of state, is this considered good form or is it not possible to do this? if not, what are the alternatives?
Answer the question
In order to leave comments, you need to log in
If you need to update some state at the application level on a click in the header of one of the boards, then I think redux is better suited here.
In other cases, such as at the module level, lifting up state is considered good practice.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question