I am developing a web application using React JS. Now, I am trying to programmatically redirect to another route. I can redirect like this.
this.props.history.push('/event/${this.props.id}/edit');
But when I use that in the child component it is not working. This is my scenario. I have a parent component called, EventListComponent. Inside that component, I render another child component called EventWidgetComponent. I am redirecting in the child component. But this.props.history is always undefined when I use it in the child component. How can I fix it?