How to use the react-router.applyRouterMiddleware 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 cityofasheville / simplicity2 / internals / templates / app.js View on Github external
const render = (translatedMessages) => {
  ReactDOM.render(
    
      
        
      
    ,
    document.getElementById('app')
  );
};
github alanshaw / david-www / src / ui / routes.jsx View on Github external
}

  // If the route component has a static shouldUpdateScroll function then
  // use this to determine if scroll middleware should be applied
  const useScrollMiddleware = useScroll((prevRouterProps, routerProps) => {
    const component = routerProps.routes[routerProps.routes.length - 1].component

    if (component && component.shouldUpdateScroll) {
      return component.shouldUpdateScroll(prevRouterProps, routerProps)
    }

    return true
  })

  return (
    
      
        
        
        
        
      
    
  )
}
github edp963 / davinci / webapp / app / app.tsx View on Github external
const render = (messages) => {
  ReactDOM.render(
    
      
        
          
        
      
    ,
    MOUNT_NODE
  )
}
// declare const module: any
github litdevelopers / tinder / app / app.js View on Github external
const render = (translatedMessages) => {
  ReactDOM.render(
    
      
        
      
    ,
    document.getElementById('app')
  );
};
github jackyon / react-redux-boilerplate / app / index.js View on Github external
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { applyRouterMiddleware, Router } from 'react-router';
import useScroll from 'react-router-scroll';
import { history, store } from './history';
import routes from './routes';

render(
	
		
	,
	document.getElementById( 'app' )
);
github xkawi / react-universal-saga-modular / src / containers / Root / Root.prod.js View on Github external
render() {
    const { store, history, routes, type, renderProps } = this.props;
    return (
      
        <div>
          {type === 'server'
            ? 
            : 
            }
        </div>
      
    );
  }
}
github learnrelay / learnrelay / src / index.tsx View on Github external
} else {
      analytics.identify(Cookies.get('learnrelay_guestid'), trackHistory)
    }
  }
})

function shouldScrollUp(previousProps, {location}) {
  return location.hash === '' &amp;&amp; (previousProps === null || previousProps.location.pathname !== location.pathname)
}

ReactDOM.render(
  (
    
  ),
  document.getElementById('root')
)
github charlieschwabacher / gestalt / packages / blogs-example / client / index.js View on Github external
import Relay, {DefaultNetworkLayer} from 'react-relay';
import {Router, browserHistory, applyRouterMiddleware} from 'react-router';
import useRelay from 'react-router-relay';
import routes from './routes';

Relay.injectNetworkLayer(
  new DefaultNetworkLayer('/graphql', {
    credentials: 'include',
  })
);

ReactDOM.render(
  ,
  document.getElementById('root')
);
github EYHN / hexo-theme-one / src / main.tsx View on Github external
const Main = ({store}: { store: Store }) =&gt; (
  
    
      
        
        
        
        
        
        
      
    
  
);