1import React, { Component } from 'react';
2import { render } from 'react-dom';
3import { BrowserRouter, Route, Switch, Link } from 'react-router-dom';
4import { Home } from 'wherever-you-put-it/home.component.jsx';
5import { Something } from 'wherever-you-put-it/something.component.jsx';
6import { SomethingElse } from 'wherever-you-put-it/something-else.component.jsx';
7
8class App extends Component {
9 render() {
10 return (
11 <BrowserRouter>
12 <Switch>
13 <Route path="/">
14 <Home />
15 </Route>
16 <Route path="/something">
17 <Something />
18 </Route>
19 <Route path="/somethingelse">
20 <SomethingElse />
21 </Route>
22 </Switch>
23 <SomeComponentOrElement>
24 <Link to="/">Home</Link>
25 <Link to="/something">Something</Link>
26 <Link to="/somethingelse">Something Else</Link>
27 </SomeComponentOrElement>
28 </BrowserRouter>
29 )
30 }
31}
32
33render(<App />, document.getElementById('app'));
1import React from 'react';
2import { Link } from 'react-router';
3
4class List extends React.Component {
5 render() {
6 return (
7 <div>
8 <p>Please choose a repository from the list below.</p>
9 <ul>
10 <li><Link to="/react">React</Link></li>
11 </ul>
12 </div>
13 );
14 }
15}
16
17export default List;