How to use the redux-router.pushState function in redux-router

To help you get started, we’ve selected a few redux-router 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 nus-mtp / cubist / src / webapp / components / _containers / AuthorisationContainer.js View on Github external
componentWillMount() {
    const { dispatch, user } = this.props;
    if (!user) {
      if (process.env.BROWSER) {
        dispatch(pushState(null, '/'));
      } else {
        dispatch(ServerActions.redirect('/'));
      }
    }
  }
github nus-mtp / cubist / src / webapp / components / _containers / RegisterContainer.js View on Github external
componentWillMount() {
    const { dispatch, ownUserId } = this.props;
    if (ownUserId) {
      if (process.env.BROWSER) {
        dispatch(pushState(null, '/'));
      } else {
        dispatch(ServerActions.redirect('/'));
      }
    }
  }
github nus-mtp / cubist / src / webapp / components / _containers / ResetPasswordContainer.js View on Github external
componentWillMount() {
    const { dispatch, ownUserId } = this.props;
    if (ownUserId) {
      if (process.env.BROWSER) {
        dispatch(pushState(null, '/'));
      } else {
        dispatch(ServerActions.redirect('/'));
      }
    }
  }
github nus-mtp / cubist / src / webapp / components / _containers / LoginContainer.js View on Github external
componentWillMount() {
    const { dispatch, ownUserId } = this.props;
    if (ownUserId) {
      if (process.env.BROWSER) {
        dispatch(pushState(null, '/'));
      } else {
        dispatch(ServerActions.redirect('/'));
      }
    }
  }
github nus-mtp / cubist / src / webapp / components / _containers / LoginContainer.js View on Github external
componentWillReceiveProps(nextProps) {
    const { dispatch } = this.props;
    if (nextProps.success && nextProps.ownUserId) {
      dispatch(pushState(null, '/'));
    }
  }
github nus-mtp / cubist / src / webapp / components / _containers / BrowseContainer.js View on Github external
_onSearchFormSubmit = (e) => {
    e.preventDefault();
    const { dispatch } = this.props;
    this.state.formData[PAGE] = 1;
    dispatch(pushState(null, '/browse?' + this.convertStateToQuery()));
  };
github nus-mtp / cubist / src / webapp / components / _containers / AppContainer.js View on Github external
_onSearchFormSubmit = (e) => {
    e.preventDefault();
    const { dispatch } = this.props;
    const trimmedString = this.state.formData[SEARCH_FIELD].trim();
    const queryString = qs.stringify(
      { searchString: trimmedString.length !== 0 ? trimmedString : undefined });
    dispatch(pushState(null, '/browse?' + queryString));
  };
}
github pubpub / pubpub / src / containers / Editor / EditorModals.jsx View on Github external
componentWillReceiveProps(nextProps) {
		if (nextProps.editorData.get('publishSuccess')) {
			this.props.dispatch(pushState(null, ('/pub/' + nextProps.slug)));
		}
		if (!this.state.initialized && nextProps.editorData.getIn(['pubEditData', 'token'])) {
			this.initializeEditorData(nextProps.editorData.getIn(['pubEditData', 'token']));
		}

	},
github pubpub / pubpub / src / containers / JournalProfile / JournalProfile.jsx View on Github external
componentWillReceiveProps(nextProps) {
		if (nextProps.journalData.get('createCollectionStatus') === 'created') {
			this.props.dispatch(pushState(null, ('/collection/' + nextProps.journalData.get('createCollectionSlug') + '/edit')));
			this.props.dispatch(clearCollectionRedirect());
		}
	},
github pubpub / pubpub / src / containers / Editor2 / Editor.jsx View on Github external
componentWillReceiveProps(nextProps) {
		if (nextProps.editorData.get('publishSuccess')) {
			this.props.dispatch(pushState(null, ('/pub/' + nextProps.slug)));
		}
		if (!this.state.initialized && nextProps.editorData.getIn(['pubEditData', 'token'])) {
			this.initializeEditorData(nextProps.editorData.getIn(['pubEditData', 'token']));
		}

		if (this.props.editorData.get('styleScoped') !== nextProps.editorData.get('styleScoped')) {
			const ref = new Firebase(FireBaseURL + this.props.slug + '/editorData/settings' );
			ref.update({styleScoped: nextProps.editorData.get('styleScoped')});
		}

	},

redux-router

Redux bindings for React Router — keep your router state inside your Redux Store.

MIT
Latest version published 8 years ago

Package Health Score

57 / 100
Full package analysis