Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react'
- import { Switch, Route } from 'react-router-dom'
- import Loadable from 'react-loadable'
- const componentsA = Loadable({
- loader: () => import('../componentsA'),
- loading: () => null,
- });
- const componentsB = Loadable({
- loader: () => import('../componentsB'),
- loading: () => null,
- });
- const componentsC = Loadable({
- loader: () => import('../componentsC'),
- loading: () => null,
- });
- const containersD = Loadable({
- loader: () => import('../containersD'),
- loading: () => null,
- });
- class Build extends Component{
- render(){
- return(
- <Switch>
- <Route path='/componentsA' component={componentsA} />
- <Route path='/componentsB' component={componentsB} />
- <Route path='/componentsC' component={componentsC} />
- <Route path='/containersD' component={containersD} />
- </Switch>
- )
- }
- }
- export default Build
Add Comment
Please, Sign In to add comment