odysseyscience / react-router-proxy-loader

Dynamically load react-router components on-demand, based on react-proxy-loader
145 stars 12 forks source link

react-router-proxy-loader and react-router@2 #18

Closed michael-hertzberg-zocdoc closed 8 years ago

michael-hertzberg-zocdoc commented 8 years ago

Just a clarification question. if react-router@2 has support for async loading, is this loader still necessary?

seanadkinson commented 8 years ago

I haven't personally started using the async loading, but if I understand it correctly, the result would be exactly the same, so yes, this component wouldn't be needed. Using require.ensure explicitly in getChildRoutes, or using this loader, would be basically the same. This module provides a convenience for grouping similar modules by name, but you could also do this yourself with the 3rd argument to require.ensure (I believe it is).

michael-hertzberg-zocdoc commented 8 years ago

@seanadkinson awesome. thanks for getting back to quickly. that answers my question. much thanks!

for reference: https://github.com/reactjs/react-router/blob/master/docs/guides/DynamicRouting.md