Skip to content
Advertisement

how to import child’s state to parent component

I want to import the child state to my parent component in order to change DOM, but I don’t know if its possible or how to do it shall I use Redux in this case ?? if not what possibly I must do to do that

Advertisement

Answer

You can create state in parent component and pass it to child component (state and setState) via props. In this case, the parent and child components will be able to use this state.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement