React-Router是否通过Webpack中断实时重新加载?

时间:2015-12-17 15:16:33

标签: webpack react-router webpack-dev-server react-hot-loader

我正在使用React-Router并且刚刚更新了我的路由以合并嵌套的URL,它似乎打破了Webpack的实时重新加载:

    

<Route path="/" component={App} ignoreScrollBehavior>

  <Route path="dashboard" component={Dashboard}>
    <Route path="greeting" component={Greeting}>
      <IndexRoute component={ButtonArray}/>
    </Route>
    <Route path="zest" component={Zest}>
      <IndexRoute component={ButtonArray}/>
    </Route>
    <Route path="blank" component={Blank}>
      <IndexRoute component={ButtonArray}/>
    </Route>
    <Route path="reports" component={Reports}/>
    <Route path="customer" component={Customer}/>
    <Route path="ads" component={Ads}/>
    <Route path="survey" component={Survey}/>
    <Route path="arrival" component={Arrival}/>
    <Route path="data_collection" component={DataCollection}/>
    <Route path="website" component={Website}/>
    <Route path="stores" component={Stores}/>
    <Route path="store_address" component={StoreAddress}/>
    <Route path="service_desks" component={ServiceDesks}/>
    <Route path="business_hours" component={BusinessHours}/>
    <Route path="customer_servants" component={CustomerServants}/>
  </Route>

</Route>

有没有人使用webpack热重装看到这个?现在,除非我在localhost:8000 /或localhost:8080 / dashboard,每当我保存更新时,实时重新加载就会出现一个神秘的(无用的)错误,指向index.html中的app.js

是否有更好的方法来合并嵌套路由,而不是我上面显示的?

我需要一个基础/端点,我需要一个/仪表板端点,然后需要所有这些嵌套端点。稍后我计划添加更多与/ dashboard平行的顶级端点(例如/ widget)

0 个答案:

没有答案