Skip to content

Instantly share code, notes, and snippets.

@Weiyuan-Lane
Last active March 10, 2019 12:05
Show Gist options
  • Save Weiyuan-Lane/8fc991c663da22110045f4df6c8832ec to your computer and use it in GitHub Desktop.
Save Weiyuan-Lane/8fc991c663da22110045f4df6c8832ec to your computer and use it in GitHub Desktop.
Base application for a react-router SPA
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