/*路由如下* 組件<ShareS2/>是個(gè)表單;* 現(xiàn)在的需求是,<shares2/>表單中的數(shù)據(jù)要顯示在<Expect/>中,能想到的就是路由參數(shù)來傳遞,數(shù)據(jù);* 有木有辦法通過 react的 props 傳遞呢?* 該如何寫呢?* */render(( <Router history={appHistory}> <Route path="/" component={Home}/> <Route path="share" component={ShareS1}/> <Route path="shares2" component={ShareS2}/> <Route path="expect" component={Expect}/> </Router>), document.getElementById('root'));組件<ShareS2/>部分代碼組件<Expect/>部分代碼
react-router 組件間傳遞數(shù)據(jù)問題?
天涯盡頭無女友
2018-09-07 10:10:26