react-router-tutorial icon indicating copy to clipboard operation
react-router-tutorial copied to clipboard

Router may render a single route

Open DarkNightRises opened this issue 8 years ago • 2 comments
trafficstars

Multipke routes not working under a single router as given under Lesson 2 . I have installed the latest version of react-router but always getting Router must render a single route

DarkNightRises avatar Mar 19 '17 09:03 DarkNightRises

Can you provide the snippet of your code that's not working?

ghostsquad avatar Jul 25 '17 17:07 ghostsquad

import React from 'react';
import { render } from 'react-dom';
import App from './modules/App';
import Repos from './modules/Repos';
import About from './modules/About';
import { Router, Route, hashHistory } from 'react-router';

render(
  <Router history={hashHistory}>
    <Route path="/" component={App} />

    <Route path="/repos" component={Repos} />
    <Route Path="/about" component={About} />
  </Router>,
  document.getElementById('app')
);

I have this in my App.js and the code does not work for me when attempting to hit: http://localhost:8080/#/about:

Warning: [react-router] Location "/about" did not match any routes

cjones26 avatar Feb 14 '18 21:02 cjones26