G
G
groulls2020-09-20 20:52:15
JavaScript
groulls, 2020-09-20 20:52:15

Passing parameters from global state to local state and vice versa?

how to elegantly implement Props from Parent to different Child components

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Argentinium, 2020-09-20
@Argentinium

Connect the context and do not torture yourself.

R
Robur, 2020-09-21
@Robur

you don't need to store the same thing in different places and "pass the state from Parent to Child"
raise the parent's state and pass the necessary values ​​in props, use directly from props in child components. If you need to change - pull the handler from the child, and let the parent change what needs to be changed and send new props.
well, or as already said - the context, if this state is needed a lot where .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question