How to use the react-router-redux.replace function in react-router-redux

To help you get started, we’ve selected a few react-router-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shinima / battle-city / app / components / GameoverScene.tsx View on Github external
componentDidMount() {
    document.addEventListener('keydown', this.onKeyDown)
    const { game, dispatch } = this.props
    if (game.status === 'idle') {
      dispatch(replace('/'))
    }
    // 这里不考虑这种情况:玩家在游戏过程中手动在地址栏中输入了 /gameover
  }
github quiltdata / quilt / catalog / app / containers / OAuth2 / index.js View on Github external
componentWillMount() {
    const { dispatch } = this.props;
    const { query } = this.props.location;
    // eslint-disable-next-line object-curly-newline, camelcase
    const { refresh_token, access_token, expires_at, next = '/' } = query;
    const tokens = {
      refresh_token,
      access_token,
      expires_at: expires_at ? parseFloat(expires_at, 10) : Infinity, // eslint-disable-line camelcase
    };
    dispatch(storeTokens(tokens));
    dispatch(getAuth(tokens));
    dispatch(replace(next));
  }
github peerplays-network / peerplays-core-gui / dl / src / actions / NavigateActions.js View on Github external
return (dispatch) => {
      let url = redirectAfterLogin ? `/login?next=${redirectAfterLogin}` : '/login';

      if (withReplace) {
        dispatch(replace(url));
      } else {
        dispatch(push(url));
      }
    };
  }

react-router-redux

Ruthlessly simple bindings to keep react-router and redux in sync

MIT
Latest version published 8 years ago

Package Health Score

58 / 100
Full package analysis