score:-2

import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';

const Home = () => <p>Home</p>;
const About = () => <p>about</p>;
const Topics = () => <p>topics</p>;

const Example = () => (
  <Router>
    <div>
      <ul>
        <li><Link to="/">Home</Link></li> 
        <li><Link to="/">Home 1</Link></li>
        <li><Link to="/">Home 2</Link></li>
        <li><Link to="/about">About</Link></li>
        <li><Link to="/topics">Topics</Link></li>
      </ul>

      <hr />

      <Route exact path="/" component={Home} />
      <Route path="/about" component={About} />
      <Route path="/topics" component={Topics} />
    </div>
  </Router>
);

render(<Example />, document.body);

score:1

<Router history={history}>...</Router>

Related Query

More Query from same tag