Based on react-proxy-loader, adapted for react-router route handlers.
npm install react-router-proxy-loader
Right now, this library depends on bluebird for promises, which is an amazing library. May be a little heavy, though, so feel free to send a PR if you'd rather it use something else.
Use when requiring the handler for a Route, and the component will only be loaded when the route is rendered.
<Route name="user" handler={require('react-router-proxy!./User.jsx')} />Note that willTransitionTo and willTransitionFrom will still be called on the dynamically-loaded component.