Last active
October 19, 2017 18:48
-
-
Save lopezjurip/0703eb5feaa6a96b0ee60c36578f18d8 to your computer and use it in GitHub Desktop.
Using create-react-app with React Router + Express.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/routes.js | |
import React from 'react'; | |
import { Router, Route } from 'react-router'; | |
import App from './components/App'; | |
import About from './components/About'; | |
import NotFound from './components/NotFound'; | |
const Routes = (props) => ( | |
<Router {...props}> | |
<Route path="/" component={App} /> | |
<Route path="/about" component={About} /> | |
<Route path="*" component={NotFound} /> | |
</Router> | |
); | |
export default Routes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With react-router-dom
Guide for migration