Skip to content

Instantly share code, notes, and snippets.

@Louiefigz
Created May 14, 2017 02:56
Show Gist options
  • Save Louiefigz/18831b76eff073024d962c090ac6ec69 to your computer and use it in GitHub Desktop.
Save Louiefigz/18831b76eff073024d962c090ac6ec69 to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';
import Home from './components/home';
import Detail from './components/detail';
//require the component forecast for our
///forecast/:city path
import Forecast from './components/forecast';
// Importing React Router libraries
import { Router, Route, browserHistory, IndexRoute } from 'react-router';
ReactDOM.render(
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route path="/forecast/:city" component={Forecast}/>
<Route path="/detail/:city" component={Detail}/>
</Route>
</Router>,
document.getElementById('root')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment