mhaagens / react-mobx-react-router4-boilerplate

React, React-Router 4, MobX and Webpack 2-boilerplate with async routes.
560 stars 137 forks source link

use Switch , Component unchanging #48

Closed zanjs closed 7 years ago

zanjs commented 7 years ago

react-route

<Switch>
<Route
    exact
    path={RoutePath.home}
    render={props => (
      <LazyRoute {...props} component={import("../components/home")} />
    )}
  />
<Route
  path={RoutePath.topics}
  render={props => (
    <LazyRoute {...props} component={import("../components/topics")} />
  )}
/>
<Route
  path={RoutePath.histtory}
  render={props => (
    <LazyRoute {...props} component={import("../components/history")} />
  )}
/>
<Route
  path={RoutePath.count}
  render={props => (
    <LazyRoute {...props} component={import("../components/count")} />
  )}
/>
<Route
  path={RoutePath.birds}
  render={props => (
    <LazyRoute {...props} component={import("../components/birds")} />
  )}
/>
<Route
  path={RoutePath.about}
  render={props => (
    <LazyRoute {...props} component={import("../components/about")} />
  )}
/>
<Route
    path={RoutePath.lazyRoute}
    render={props => (
      <LazyRoute {...props} component={import("../components/lazyRoute")} />
    )}
  />
<Route component={NotFound}/>
</Switch>