0
나는 그렇게 여러 노선에서 라우터에게 반작용 4
- http://localhost/page1가 페이지 3 렌더링해야
- http://localhost/page3 페이지 2 렌더링해야
- http://localhost/page2 페이지 1 렌더링해야 다른 경로 에 다른 구성 요소를 렌더링 할 요구 사항이
- http://localhost/ 동물을 렌더링해야합니다.
다음 구성을 사용하고 있습니까? 이 권리가 있습니까, 아니면 공동체가이 용도로 사용할 다른 것을 권유합니까?
import {Route, Switch} from 'react-router';
import {ConnectedRouter} from 'react-router-redux';
<ConnectedRouter history={app.history}>
<div>
<Route exact path="/page1" component={Page1} />
<Route exact path="/page2" component={Page2} />
<Route exact path="/page3" component={Page3} />
<Route exact path="/:animal?" component={Animal} />
</div>
</ConnectedRouter>
OP가 자신의 코드를 작성한 방식에서 v4를 사용한다고 가정하면이 문제는 도움이되지 않습니다. –
@ShubhamKhatri 예 v4를 사용하고 질문 제목에서 언급했습니다. – learner