Skip to content

Instantly share code, notes, and snippets.

@lopezjurip
Last active October 19, 2017 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lopezjurip/983b6398fec734788a5cd8df7b1b956e to your computer and use it in GitHub Desktop.
Save lopezjurip/983b6398fec734788a5cd8df7b1b956e to your computer and use it in GitHub Desktop.
// src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import Routes from './routes';
import './index.css';
ReactDOM.render(
<Routes history={browserHistory} />,
document.getElementById('root')
);
@tiagobbraga
Copy link

tiagobbraga commented Oct 19, 2017

With react-router-dom

import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom'
import Routes from './routes';

import './index.css';

ReactDOM.render(
  <BrowserRouter>
    <Routes />
  </BrowserRouter>,
  document.getElementById('root')
);

Guide for migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment