Last active
March 10, 2019 12:05
-
-
Save Weiyuan-Lane/8fc991c663da22110045f4df6c8832ec to your computer and use it in GitHub Desktop.
Base application for a react-router SPA
This file contains hidden or 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
import Navbar from 'scripts/components/Navbar' | |
import React, { Component } from 'react' | |
import { withRouter } from 'react-router' | |
import { renderRoutes } from 'react-router-config' | |
import { routes } from 'scripts/routes' | |
class BaseSPA extends Component { | |
constructor(props) { | |
super(props) | |
} | |
render() { | |
return ( | |
<React.Fragment> | |
<Navbar {...this.props} /> | |
{renderRoutes(routes)} | |
</React.Fragment> | |
) | |
} | |
} | |
export default withRouter(BaseSPA) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment