Guest User

Untitled

a guest
Dec 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import React, { Component } from 'react'
  2. import { Switch, Route } from 'react-router-dom'
  3.  
  4. import Loadable from 'react-loadable'
  5.  
  6. const componentsA = Loadable({
  7. loader: () => import('../componentsA'),
  8. loading: () => null,
  9. });
  10. const componentsB = Loadable({
  11. loader: () => import('../componentsB'),
  12. loading: () => null,
  13. });
  14. const componentsC = Loadable({
  15. loader: () => import('../componentsC'),
  16. loading: () => null,
  17. });
  18. const containersD = Loadable({
  19. loader: () => import('../containersD'),
  20. loading: () => null,
  21. });
  22.  
  23. class Build extends Component{
  24. render(){
  25. return(
  26. <Switch>
  27. <Route path='/componentsA' component={componentsA} />
  28. <Route path='/componentsB' component={componentsB} />
  29. <Route path='/componentsC' component={componentsC} />
  30. <Route path='/containersD' component={containersD} />
  31. </Switch>
  32. )
  33. }
  34. }
  35.  
  36. export default Build
Add Comment
Please, Sign In to add comment