Skip to content

Combining with <link rel="prefetch" /> results in loading async components twice #77

Open
@doque

Description

@doque

Hello,

first off thanks for this framework, I love the simplicity and especially the thorough documentation how to add this. We're using it together with react-universally and it's awesome.

But I'm having a small issue while trying to optimize requests to the server. I've got all my bundles set up, the lazy loading works fine: amain bundle that contains a login screen and a "main" view, then I've got a config bundle which is lazy-loaded when navigating to the settings page).

Then, funny things happen. The prefetch seemingly is done, but Chrome (Canary Build) ignores the response (I was able to reproduce this with FF also, where the response was fine, so I'm blaming Chrome for this):

image

Then, navigating to the settings page results in the supposedly prefetched bundle to be loaded again and, while being loaded, I'm presented with a flash of white nothing (which I'm assuming is due to the loadingComponent of null being rendered in the meantime).

Any ideas how to tackle this?

Thanks for your help!

Activity

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

        Participants

        @doque

        Issue actions

          Combining with <link rel="prefetch" /> results in loading async components twice · Issue #77 · ctrlplusb/react-async-component