react-router-tutorial
react-router-tutorial copied to clipboard
Router may render a single route
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
Can you provide the snippet of your code that's not working?
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