我正在使用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终结点,然后是在此之下的所有嵌套终结点。 稍后,我计划添加更多与/ dashboard并行的顶级端点(例如/ widget)