react-router-component icon indicating copy to clipboard operation
react-router-component copied to clipboard

Disabling async prefetching

Open tastyeggs opened this issue 11 years ago • 0 comments

How do I go about disabling prefetch of async components? Typically my async components show some kind of a spinner, along with other contextual elements when state is being fetched.

Ever since I integrated in this router, this no longer happens, and it looks like the state is being prefetched in AsyncRouteRenderingMixin.

Can this be disabled using a prop?

Currently I'm monkey patching this: var AsyncRouteRenderingMixin = require('react-router-component/lib/AsyncRouteRenderingMixin'); function AsyncRouteRenderingMixin_setRoutingState(state,cb) { this.replaceState(state, cb); } if (AsyncRouteRenderingMixin.setRoutingState != AsyncRouteRenderingMixin_setRoutingState) { AsyncRouteRenderingMixin.setRoutingState = AsyncRouteRenderingMixin_setRoutingState; }

tastyeggs avatar Jul 22 '14 01:07 tastyeggs