How to use the history/lib/createHashHistory function in history

To help you get started, we’ve selected a few history 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 taion / react-router-scroll / test / useScroll.spec.js View on Github external
function createHashHistoryWithoutKey() {
  // Avoid persistence of stored data from previous tests.
  window.sessionStorage.clear();

  return createHashHistory({ queryKey: false });
}
github regentmarkets-repo-archive / binary-next-gen / src / root.js View on Github external
render() {
        const history = new HashHistory();
        const liveData = new LiveData(store);
        // 
        liveData.init();
        return (
            
                
            
        );
    }
}
github taofed / react-web / Libraries / Navigator / Navigator.web.js View on Github external
import NavigationContext from 'ReactNavigationContext';
import NavigatorBreadcrumbNavigationBar from 'ReactNavigatorBreadcrumbNavigationBar';
import NavigatorNavigationBar from 'ReactNavigatorNavigationBar';
import NavigatorSceneConfigs from 'ReactNavigatorSceneConfigs';
import PanResponder from 'ReactPanResponder';
import StyleSheet from 'ReactStyleSheet';
import Subscribable from './polyfills/Subscribable';
import TimerMixin from 'react-timer-mixin';
import View from 'ReactView';
import clamp from './polyfills/clamp';
import flattenStyle from 'ReactFlattenStyle';
import invariant from 'fbjs/lib/invariant';
import rebound from 'rebound';
import createHistory from 'history/lib/createHashHistory';

let history = createHistory();
let _unlisten;

// TODO: this is not ideal because there is no guarantee that the navigator
// is full screen, hwoever we don't have a good way to measure the actual
// size of the navigator right now, so this is the next best thing.
const SCREEN_WIDTH = Dimensions.get('window').width;
const SCREEN_HEIGHT = Dimensions.get('window').height;
const SCENE_DISABLED_NATIVE_PROPS = {
  pointerEvents: 'none',
  style: {
    top: SCREEN_HEIGHT,
    bottom: -SCREEN_HEIGHT,
    opacity: 0,
  },
};
github JasonBai007 / reactSPA / app / src / login / login.jsx View on Github external
import React from 'react';
import { Form, Input, Button, notification} from 'antd';
import createHistory from 'history/lib/createHashHistory';

import './login.less'

const FormItem = Form.Item;
const history = createHistory();

class LoginPage extends React.Component {
    constructor(props) {
        super(props);
    }

    handleSubmit = (e) => {
        e.preventDefault();
        let n = this.props.form.getFieldsValue().username;
        let p = this.props.form.getFieldsValue().password;
        if (n === 'ilovejasonbai' && p === 'ilovejasonbai') {
            // 表单的路由处理                       
            history.push('/');
        } else {
            this.openNotificationWithIcon('info');
        }
github fanruan / intelli-swift-core / fbi_h5 / src / com / fr / bi / h5 / src / lib / Navigator / Navigator.web.js View on Github external
import NavigationContext from './Navigation/NavigationContext';
import NavigatorBreadcrumbNavigationBar from './NavigatorBreadcrumbNavigationBar';
import NavigatorNavigationBar from './NavigatorNavigationBar';
import NavigatorSceneConfigs from './NavigatorSceneConfigs';
import PanResponder from '../PanResponder/PanResponder.web';
import StyleSheet from '../StyleSheet/StyleSheet.web';
import Subscribable from './polyfills/Subscribable';
import TimerMixin from 'react-timer-mixin';
import View from '../View/View.web';
import clamp from './polyfills/clamp';
import flattenStyle from '../StyleSheet/FlattenStyle.web.js';
import invariant from 'fbjs/lib/invariant';
import rebound from 'rebound';
import createHistory from 'history/lib/createHashHistory';

let history = createHistory();
let _unlisten;

// TODO: this is not ideal because there is no guarantee that the navigator
// is full screen, hwoever we don't have a good way to measure the actual
// size of the navigator right now, so this is the next best thing.
const SCREEN_WIDTH = Dimensions.get('window').width;
const SCREEN_HEIGHT = Dimensions.get('window').height;
const SCENE_DISABLED_NATIVE_PROPS = {
  pointerEvents: 'none',
  style: {
    top: SCREEN_HEIGHT,
    bottom: -SCREEN_HEIGHT,
    opacity: 0
  }
};
github redradix / curso-react-flux / ejercicios / tema5 / src / routes / example.js View on Github external
import React from 'react';
import createHistory from 'history/lib/createHashHistory';
import { Router, Route, IndexRoute, Link } from 'react-router';


let history = createHistory({
  queryKey: false
});

function loadContactAsync(id){
  console.log('Loading data for contact', id);
  setTimeout(() => {
    console.log('Data fetched!');
    done();
  }, 500);
}

function loadContact(nextState, replaceState){
  alert('Fetch data por contact' + nextState.params.id);
}

const Layout = React.createClass({
github nuclearspike / kivalensjs / react / src / scripts / app.js View on Github external
airbrake.addFilter(notice => {
    notice.context.lender_id = kivaloans.lender_id
    return notice;
});

window.addEventListener("error", airbrake.onerror);

import React from 'react'
import Reflux from 'reflux'
import ReactDOM from 'react-dom'
import Router from 'react-router'
import {Route, Redirect, IndexRoute} from 'react-router'
import {Grid,Jumbotron} from 'react-bootstrap'

import createHistory from 'history/lib/createHashHistory'
var history = createHistory({queryKey: false})

import {KLNav, KLFooter, Search, Loan, Basket, Options, About, Details, Schedule,
    Criteria, ClearBasket, Live, Teams, NotFound, PromptModal, AlertModal, SnowStack,
    Outdated, OnNow, Donate} from "./components"
import ga from 'react-ga';
import a from './actions'
import s from './stores'

//window.Perf = require('react-addons-perf')

window.rga = ga //react google analytics, ga is already defined
//if you want to change the page title, you will also need to change the GA rule or you'll lose all data after the change.

global.rga.event({category: 'timer', action: 'loadToStart', value: Math.round((Date.now() - window.pageStarted) / 1000)})

const App = React.createClass({
github luqin / react-bootstrap-datetimerangepicker / examples / src / js / app.js View on Github external
import React from 'react';
import ReactDOM from 'react-dom';

import { Router, Route, IndexRoute } from 'react-router';
import createHistory from 'history/lib/createHashHistory';

const history = createHistory({ queryKey: false });

import App from './components/App';
import Examples from './components/Examples';

const routes = (
  
    
      
    
  
);

ReactDOM.render(routes, document.querySelector('#app'));
github rafaelchiti / react_scaffolding / app / index.jsx View on Github external
constructor(props) {
    super(props);
    this.history = createHashHistory();
  }