반응 라우터 설정이 정상적으로 작동하지 않습니다. URL 바를 탐색하면 라우터가 반응하지만 결코 페이지를 업데이트하지 않습니다. 페이지를 다시로드하면 초기로드시 올바른 경로가 렌더링됩니다. 뒤로/앞으로 버튼을 누르면 라우터가 경로 사이를 정확하게 탐색합니다. back/forward가 반응 라우터에서 작동 할 때조차도 back/forward로 도달 할 수있는 페이지에 대한 링크를 클릭해도 아무런 변화가 없습니다.리액터 라우터는 뒤로 버튼을 누를 때만 작동합니다.
<Link to="/signup">
signup
</Link>
:
내 경로
import { Router, Route, IndexRoute, browserHistory } from 'react-router'
import AppContainer from './components/react/app_container.jsx'
import Signup from './components/react/login_and_signup/signup.jsx'
import SplashPage from './components/react/splash_page/splash_page.jsx'
export const routes = (
<Router history={browserHistory}>
<Route path="/" component={AppContainer}>
<IndexRoute component={SplashPage} />
<Route path="signup" component={Signup} />
</Route>
</Router>
);
내 응용 프로그램
import ReactDOM from 'react-dom';
import {routes} from '../imports/client/routes'
ReactDOM.render(routes, document.getElementById('app'));
내 AppContainer 내 시작 페이지에서
import React from 'react';
let AppContainer = React.createClass({
componentWillReceiveProps(nextProps){
console.log("next props? ", nextProps);
},
render(){
return <div>{this.props.children}</div>
}
});
export default AppContainer;
부트 스트랩 componentWillReceiveProps에서 CONSOLE.LOG가 아닌 렌더링되지 않고 URL /에서
- 페이지 새로 고침, 시작 페이지가로드
- 를 클릭 가입 링크/가입했지만 가입 구성 요소에 대한 URL 변경 : 16,여기
은 내가 할 행동입니다 출력
- 페이지를 새로 고침/가입과 가입 성분 올바르게
- 눌러 렌더링에서 백 버튼 및 스플래시 페이지 성분 올바르게 렌더링하고 소품 componentWillReceiveProps로부터 출력 동안
- 앞뒤로 B utton은/가입이 지점에서 시작 페이지
- 를 클릭 가입 링크 URL 변경을 잘 작동하지만 아무것도 내가 모든 것을 올바르게 구성되어 있지만, 라우터가 자동으로 다시 제외 실패 반응 말할 수있는 지금까지
을 발생하지/앞으로 단추.
저는 React 15.0.1과 React Router 2.4.1을 사용하고 있습니다.