Similar to react-router - pass props to handler component but in my case my component was declared in a variable in my case elem.component
and I am trying to build an array of routes passing a showModal
function.
This is what I had tried so far
routes.push(
<Route key={elem.to} exact path={elem.to}
component={elem.component} showModal={this.props.showModal}/>)
I was looking at the render methods for the other answers but they have the component defined in the function which I do not have in my case.