How to use the react-router.browserHistory 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 apazzolini / rook / lib / client.js View on Github external
var scrollHistory = (0, _useStandardScroll2.default)(function () {
  return _reactRouter.browserHistory;
})();
github Zach417 / churchetto-web / client / js / components / Churches / Index.jsx View on Github external
var React = require('react');
var S = require('string');
var browserHistory = require('react-router').browserHistory;
var Style = require('./Style.jsx');
var ListItem = require('./ListItem.jsx');
var ButtonPrimary = require('../Button/Index.jsx').Primary;
var Input = require('../Form/Index.jsx').Input;
var ChurchStore = require('../../stores/ChurchStore');

var Churches = React.createClass({
  getInitialState: function () {
    return {
      churches: [],
      isLoading: true,
    }
  },

  componentWillMount: function () {
    ChurchStore.get(function (docs) {
github Zach417 / churchetto-web / client / js / components / Campus / Navigation.jsx View on Github external
var React = require('react');
var browserHistory = require('react-router').browserHistory;
var Style = require('./Style.jsx');
var ButtonSecondaryLarge = require('../Button/Index.jsx').Secondary.Large;

var Navigation = React.createClass({
  render: function () {
    return (
      <div style="{Style.navigationContainer}">
        <div>
          <div style="{{padding:&quot;0&quot;}}">
            
            
          </div>
      </div>
    </div>
    )
  },
github Zach417 / churchetto-web / client / js / components / Churches / ListItem.jsx View on Github external
var React = require('react');
var $ = require('jquery');
var browserHistory = require('react-router').browserHistory;
var Style = require('./Style.jsx');

var ListItem = React.createClass({
  getInitialState: function () {
    return {
      isHovered: ''
    }
  },

  componentWillMount: function () {
    this.setState({
      isHovered: false,
    });
  },

	render: function () {
github hkparker / Wave / assets / app.js View on Github external
'Logout',
						React.createElement('span', { className: 'glyphicon glyphicon-log-out pull-right logout-icon' })
					)
				)
			)
		),
		props.children
	);
};

ReactDOM.render(React.createElement(
	_reactRedux.Provider,
	{ store: store },
	React.createElement(
		_reactRouter.Router,
		{ history: _reactRouter.browserHistory },
		React.createElement(
			_reactRouter.Route,
			{ path: '/', component: App },
			React.createElement(_reactRouter.IndexRoute, { component: _dashboard.Dashboard }),
			React.createElement(_reactRouter.Route, { path: '/dashboard', component: _dashboard.Dashboard })
		)
	)
), document.getElementById('content'));
github kogg / InstantLogoSearch / browser.jsx View on Github external
var _              = require('underscore');
var browserHistory = require('react-router').browserHistory;
var Provider       = require('react-redux').Provider;
var React          = require('react');
var ReactDOM       = require('react-dom');
var Router         = require('react-router').Router;

var routes = require('./components/routes');
var Store  = require('./store');

var state;
try {
	state = JSON.parse(document.getElementById('react-state').innerHTML);
} catch (err) {
	switch (err.name) {
		case 'SyntaxError':
			global.location.reload(true);
			break;
github scaphold-io / react-apollo-starter-kit / lib / js / components / App / App.js View on Github external
return acc || err.status === 401;
            }, false);
            if (unauthed) {
              localStorage.clear();
              that.setState({
                user: result.data.getUser,
                loading: false
              });
            }
          } else {
            localStorage.setItem('currentUsername', result.data.getUser.username);
            that.setState({
              user: result.data.getUser,
              loading: false
            });
            _reactRouter.browserHistory.push('/home');
          }
        },
        error: function error(_error) {
github gaoxiaoliangz / readr / assets / built / es5 / containers / Signin.js View on Github external
setTimeout(function () {
                    _reactRouter.browserHistory.push('/');
                }, 600);
            }).catch(function (err) {
github otothea / docker-ui / dist / 1aac66a8-app.js View on Github external
}, function (err) {
  var location = _reactRouter.browserHistory.getCurrentLocation();
  if (err.response && err.response.status === 403) {
    return _reactRouter.browserHistory.push('/login?redirect=' + encodeURIComponent(location.pathname + location.search + location.hash));
  }

  return Promise.reject(err);
});