Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 7, 2017 03:23
Show Gist options
  • Save tkssharma/9a150aabaf404abeb00fb535246321b5 to your computer and use it in GitHub Desktop.
Save tkssharma/9a150aabaf404abeb00fb535246321b5 to your computer and use it in GitHub Desktop.
import ReactDOM from 'react-dom'
import React from 'react'
import { BrowserRouter, Switch, Route, NavLink } from 'react-router-dom'
import { Home, BasicRouting, Blocking } from './Components'
ReactDOM.render(
<BrowserRouter>
<div>
<ul>
<li><NavLink to="/" activeClassName="active">Home</NavLink></li>
<li><NavLink to="/basic-routing" activeClassName="active">BasicRouting</NavLink></li>
</ul>
<Switch>
<Route path="/" component={Home} exact={true} />
<Route path="/basic-routing" component={BasicRouting} />
</Switch>
</div>
</BrowserRouter>
, document.getElementById('main'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment