React router Switch behavior
问题 ( react-router-dom version: 4.1.1) I have working routes set up, but I'm a bit confused about why the <Switch> was necessary: index.js import React from 'react'; import { HashRouter, Route, Switch } from 'react-router-dom'; import App from './components/App.jsx'; import FridgePage from './components/FridgePage.jsx'; ReactDOM.render( <HashRouter> <Switch> <Route exact path="/" component={App} /> <Route path="/fridge" component={FridgePage} /> </Switch> </HashRouter>, document.getElementById(