I am working on a reactjs project where i have to pass props form component A to Component B now , Component A has the following code inside render function:
{this.state.showComponentedit ?
<div>
<Redirect to={'/editB'} editdata={this.state.feedData} />: null
</div>
}
I am getting the current data passed by B in A component using following code:
// inside a random function which will be invoked on button press
console.log("Props from B", this.props.edidata);
The edidata is null in Component A. how can i get the value when i am invoking the rooute "editB" and use that value in component B. Thank you