Skip to content

Instantly share code, notes, and snippets.

@nitish24p
Last active January 18, 2018 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitish24p/f3522a5c83621464f59a0609f9575231 to your computer and use it in GitHub Desktop.
Save nitish24p/f3522a5c83621464f59a0609f9575231 to your computer and use it in GitHub Desktop.
Code splitting with Higher order Components
import * as RoutingConstants from './constants/RoutingConstants';
import { Route, Switch } from 'react-router-dom';
import AboutUs from './pages/AboutUs';
import Products from './pages/Products';
import Homepage from './pages/Homepage';
import React, { Component } from 'react';;
class App extends Component<{}, {}> {
render() {
return (
<div>
<Switch>
<Route exact path={'/'} component={Homepage} />
<Route exact path={'/products'} component={Products} />
<Route exact path={'/about-us'} component={AboutUs} />
</Switch>
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment