我有嵌套如使用帶開關如下反應路由器4如何使用React Router 4將開關傳遞給this.props.children?
<MainComponent>
<ChildComponent></ChildComponent>
<ChildComponent></ChildComponent>
<ChildComponent></ChildComponent>
<MainComponent>
在主成分頁我有一些狀態,我想通過作爲道具this.props.children。 在主要組件渲染方法中,我寫了{this.props.children}來訪問子組件。現在,如何通過我的CustomProps到this.props.children
在此先感謝幫助
這裏是你的問題https://stackoverflow.com/questions/32370994/how-to-pass-props-to-this-props答案讓你的狀態 - 兒童 –