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

To help you get started, we’ve selected a few react-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 tierratelematics / ninjagoat / scripts / navigation / LocationHandler.ts View on Github external
replaceLocation(url: string) {
        browserHistory.replace(url);
    }
}
github freedomexio / rocketx-condenser / src / app / components / elements / SortOrder / index.jsx View on Github external
const handleChange = tag => sort => {
        browserHistory.replace(makeRoute(tag, sort));
    };
github beachio / chisel / src / containers / LinksEmail / PasswordSetSuccess / PasswordSetSuccess.js View on Github external
onLogin = event => {
    event.preventDefault();
    
    if (this.props.authorized)
      browserHistory.replace(`/${USERSPACE_URL}`);
    else
      browserHistory.replace(`/${SIGN_URL}`);
    
    return false;
  };
github alamgirqazi / kolaboard / app / components / toolbar.jsx View on Github external
profile() {
    Store.app = false;
    Store.events = false;
    Store.timetable = false;
    Store.invites = false;

    Store.privatenote = false;
    Store.dashboard = false;
    browserHistory.replace("/profile");
  }
  settings() {
github alamgirqazi / kolaboard / app / components / toolbars / msgtoolbar.jsx View on Github external
profile() {
    browserHistory.replace("/profile");
  }
  settings() {
github processing / p5.js-web-editor / client / modules / IDE / components / ClassroomView.jsx View on Github external
openClassroomSettings() {
    this.props.getClassroom(this.props.classroom.id);
    browserHistory.replace(`/classrooms/${this.props.classroom.id}/edit`);
  }
github getsentry / sentry / src / sentry / static / sentry / app / views / admin / adminUserEdit.jsx View on Github external
async deleteUser() {
    await this.api.requestPromise(this.userEndpoint, {
      method: 'DELETE',
      data: {hardDelete: true, organizations: []},
    });

    addSuccessMessage(t("%s's account has been deleted.", this.state.user.email));
    browserHistory.replace('/manage/users/');
  }
github getsentry / sentry / src / sentry / static / sentry / app / views / onboarding / onboarding.jsx View on Github external
validateActiveStep() {
    if (this.activeStepIndex === -1) {
      const firstStep = this.props.steps[0].id;
      browserHistory.replace(`/onboarding/${this.props.params.orgId}/${firstStep}/`);
    }
  }
github huridocs / uwazi / app / react / utils / api.js View on Github external
const handleErrorStatus = error => {
  if (error.status === 401) {
    browserHistory.replace('/login');
  } else if (error.status === 404) {
    browserHistory.replace('/404');
  } else if (error.status === 409) {
    store.dispatch(notify(error.json.error, 'warning'));
  } else if (error.status === 500) {
    store.dispatch(notify('An error has occurred', 'danger'));
  } else if (isNonUsualApiError(error)) {
    store.dispatch(notify(error.json.error, 'danger'));
  } else if (error instanceof TypeError) {
    store.dispatch(notify('Could not reach server. Please try again later.', 'danger'));
  } else {
    store.dispatch(notify('An error has occurred', 'danger'));
  }
};