Pre resolve an asyncComponent when another component resolves · Issue #43 · ctrlplusb/react-async-component · GitHub
Skip to content

Pre resolve an asyncComponent when another component resolves #43

Open

Description

@georgehenderson

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]
})

Activity

  1. georgehenderson commented on May 6, 2017

    @georgehenderson
    Author

    Or maybe more generic like:

    asyncComponent({
      ...
      onResolve: () => AnotherAsyncComponent.resolve()
    })
  2. theodesp commented on Feb 22, 2019

    @theodesp

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

  3. tarun2324 commented on Jul 31, 2020

    @tarun2324

    Is this functionality implemented by any mean??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions