당신은 항상 <Router/>
예를 들어, 외부의 새 구성 요소를 만들 수 있습니다 버전
<Route path="new" component={ApplicantsContainer}
getData={ApplicantStore.getNew.bind(ApplicantStore)}/>
<Route path="prescreen" component={ApplicantsContainer}
getData={ApplicantStore.getPrescreen.bind(ApplicantStore)}/>
는
// Assume getData is a prop you need to set in ApplicantsContainer
const ApplicantsContainerForNew = (
<ApplicantsContainer
getData={ApplicantStore.getNew.bind(ApplicantStore)}
/>
)
const ApplicantsContainerForPrescreen = (
<ApplicantsContainer
getData={ApplicantStore.getPrescreen.bind(ApplicantStore)}
/>
)
...
<Route path="new" component={ApplicantsContainerForNew}/>
<Route path="prescreen" component={ApplicantsContainerForPrescreen} />
반응-라우터 API에서는 "GetData의"속성을 찾을 수 없습니다 https://github.com/ReactTraining/react-router/blob/master/에 쓸 수있다 docs/API.md. 어디서 구 했니? 그리고 구성 요소에서 어떻게 사용할 수 있습니까? –