I am new to reactjs and I am not able to figure how to change child component state from parent component. Below is the code
<ChildComponent productCode={this.state.productCode} />
I would like the child component receive the productCode
whenever a setState
is done on productCode
in the parent component.
Publishing an event from the parent component and subscribing to the event in the child component is on top of my head.
Any suggestions?