Accepted answer

use this on top of your javascript:

var router = reactrouter.router;
var route = reactrouter.route;
var indexroute = reactrouter.indexroute;
var link =;
var browserhistory = reactrouter.browserhistory;

and remove the import statements.

i'm currently using this react-router package:


here's an example at codepen: -- it uses no import statements.


here's a minimal example of how this can be accomplished:

<!doctype html>
    <meta charset='utf-8'>
    <script src=''></script>
    <script src=''></script>
    <script src=''></script>
    <script src=''></script>
    <div id='root'></div>
    <script type='text/babel'>
      const link =,
            route = reactrouterdom.route;

      const app = props => (
            <li><link to="/">to home</link></li>
            <li><link to="/a">to a</link></li>
            <li><link to="/b">to b</link></li>

          <route path="/" exact component={home} />
          <route path="/a" component={a} />
          <route path="/b" component={b} />

      const home = props => <h1>home</h1>
      const a = props => <h1>a</h1>
      const b = props => <h1>b</h1>

      reactdom.render(<app />, document.queryselector('#root'));


for react route v4.0,please read react-router package add two js link on your page:

<script src=""></script>
<script src=""></script>

in js code you can use :

const router = window.reactrouterdom.browserrouter;
const route =  window.reactrouterdom.route;
const link =;
const prompt =  window.reactrouterdom.prompt;
const switch = window.reactrouterdom.switch;
const redirect = window.reactrouterdom.redirect;

also,can use


to out put all object like:

reactroutedom objects

Related Query

More Query from same tag