How to use the react-router.hashHistory.push 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 alpcanaydin / heygidi / app / src / components / Year.js View on Github external
loadData(year) {
    if (this.state.years.indexOf(parseInt(year, 10)) === -1) {
      hashHistory.push('/');
      return;
    }

    /* eslint-disable */
    const data = require(`../data/${year}.json`);
    /* eslint-enable */

    this.setState({
      loading: false,
      data: dataTransformer(data)
    });
  }
github younth / react-router-redux-mobile-spa / app / containers / Confirm / index.jsx View on Github external
WMApp.pay.doPay(params, data => {
            if (data.status) {
                let {globalActions} = this.props
                globalActions.savePayResult({
                    payResult: 'success'
                })
                hashHistory.push('/home')
            } else {
                console.log('支付失败')
            }
        })
    }
github cribbl / miteb-frontend / src / components / ClassroomComponent / MyPublicityEventsComponent / FAMyPublicityComponent.js View on Github external
componentDidMount () {
    if (!this.props.user) {
      hashHistory.push('/dashboard')
      return
    }
    this.setState({ fetching: true })
    firebaseDB.ref('/users/' + this.props.user.clubID).on('value',
      function (snapshot) {
        this.setState({ fetching: false })
        let events = snapshot.val().my_publicity
        for (let event in events) {
          firebaseDB.ref('publicity/' + events[event]).on('value',
            function (snapshot) {
              if (snapshot.val().FA_appr === 'pending') {
                const { myArrx } = this.state
                myArrx[snapshot.key] = snapshot.val()
                myArrx[snapshot.key].key = snapshot.key
                this.setState({ myArrx })
                this.setState({ originalArr: myArrx })
github mfeniseycopes / trakr / frontend / components / activities / activity_creation_map.jsx View on Github external
redirectToActivityDetail() {
    if (ActivityStore.newActivity() !== {}) {
      hashHistory.push({
        pathname: "/new-activity",
        query: { from: "creator" }
      });
    }
  },
github thanhtungdp / redux-500api / app / components / photos / SearchInput.js View on Github external
submitSearch(event) {
        if (event.which == 13) {
            const val = this.refs.keyword.value;
            hashHistory.push('search/' + val);
        }
    }
github colinmorris / SongSim / src / Songsim.js View on Github external
onEditButton = () => {
    if (this.state.verse.isCustom()) {
      this.setState({editing: true});
    } else {
      hashHistory.push(CUSTOM_SLUG); 
    }
  }
github hipster-labs / generator-jhipster-react / generators / client / templates / src / main / webapp / app / modules / administration / health / health.js View on Github external
getSystemHealthInfo(healthObject) {
    this.props.systemHealthInfo(healthObject);
    hashHistory.push('/admin/health-detail');
  }
github cribbl / miteb-frontend / src / components / ClassroomComponent / MyPublicityEventsComponent / MyPublicityComponent.js View on Github external
componentWillMount () {
    if (!this.props.user) {
      hashHistory.push('/dashboard')
      return
    } else {
      if (this.props.user.isSC) {
        hashHistory.replace('/dashboard/scPublicity')
        return
      }
      if (this.props.user.isFA) {
        hashHistory.replace('/dashboard/faPublicity')
        return
      }
      if (this.props.user.isAD) {
        hashHistory.replace('/dashboard/adPublicity')
        return
      }
      if (this.props.user.isSO) {
        hashHistory.replace('/dashboard/soPublicity')