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
CodePudding user response:
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.
CodePudding user response:
Please describe your case more specifically, then we will be able to propose solution.
Depending on what is your case you can use ContextApi, lifting the state up by some function called in child or as you suggested - Redux.