Skip to content

Behavior on server-side when using in conjunction with dynamic imports #27

@oyeanuj

Description

@oyeanuj

Hi @ctrlplusb, while debugging ctrlplusb/react-jobs#51 & ctrlplusb/react-jobs#56, I realized that if there were jobs on dynamic import components, then those jobs wouldn't execute on the server-side since the components are not being imported before render is considered complete.

Here is a simple summarized hierarchy that could reproduced it for me -

<App>
  <Auth> /* <--- Fetch data */
    <Switch>
      <Route component = { AsyncProfile } />
      { /* AsyncProfile dynamically imports Profile which fetches the data */ }
    </Switch>
  </Auth>
<App>

Looking through codebases of this library and react-jobs, it seems like this issue should be resolved here. Thoughts on what should be the expected behavior?

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