与react-router - pass props to handler component类似,但在我的情况下,我的组件是在变量中声明的elem.component
,我试图构建一个传递showModal
函数的路由数组。传递处理程序组件(在变量中定义)
这是我到目前为止已经试过
routes.push(
<Route key={elem.to} exact path={elem.to}
component={elem.component} showModal={this.props.showModal}/>)
我一直在寻找的答案,其他的渲染方法,但他们在这我不我的情况下具有的功能定义的组件。
我的组件是'elem.component'一个变量。 –