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

Pre resolve an asyncComponent when another component resolves

Open georgehenderson opened this issue 8 years ago • 3 comments

Thanks for building this package, it was simple to implement. I'm looking for suggestions on the best way to resolve an async component from another async component. I basically want to preload another component path after another resolves. This is just an optimization to remove the loading on a path users are likely to take next. Since they are just components, I guess I could pre initialize the next component in componentDidMount of the resolved component. Any other ideas?

It might be nice to have a built in mechanism for this like:

asyncComponent({
  ...
  thenResolve: [AnotherAsyncComp, AnotherAsyncComp2]
})

georgehenderson avatar May 05 '17 22:05 georgehenderson

Or maybe more generic like:

asyncComponent({
  ...
  onResolve: () => AnotherAsyncComponent.resolve()
})

georgehenderson avatar May 06 '17 13:05 georgehenderson

This would be a great feature as currently I would like to avoid using onLoading

theodesp avatar Feb 22 '19 10:02 theodesp

Is this functionality implemented by any mean??

tarun7886 avatar Jul 31 '20 13:07 tarun7886