Skip to content

Instantly share code, notes, and snippets.

@zackbiernat
Created December 22, 2017 22:24
Show Gist options
  • Save zackbiernat/7a18e4668b053a5c8310ef7a9e93f86f to your computer and use it in GitHub Desktop.
Save zackbiernat/7a18e4668b053a5c8310ef7a9e93f86f to your computer and use it in GitHub Desktop.
React-router boilerplate
import React from 'react';
import { Route, Router } from 'react-router-dom';
import App from 'App.js';
import Dashboard from 'Dashboard.js';
export const makeMainRoutes = () => {
return (
<Router component={App}>
<div>
<Route exact path="/" render={(props) => <App {...props} />} />
<Route path="/home" render={(props) => <Dashboard {...props} />} />
</div>
</Router>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment