Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback behaviour #977

Open
matteobaldini opened this issue Sep 13, 2023 · 1 comment
Open

Fallback behaviour #977

matteobaldini opened this issue Sep 13, 2023 · 1 comment

Comments

@matteobaldini
Copy link

Hello! I'm not sure how to use fallback with delay as described in this doc: https://loadable-components.com/docs/delay/.

Given something like:
<Route exact path="/product/books" component={loadable(() => pMinDelay(import("views/books", { fallback: <div>loading ...</div> }), 10000))} />

The way it works when implemented is:

  • blank page for 10 seconds
  • loading... for a split second
  • actual component shows up

What's the correct way to obtain the following:

  • loading... for 10 seconds
  • actual component shows up

Thanks!

@theKashey
Copy link
Collaborator

Looking at pMinDelay implementation it should work exactly like this.
Could it be that the loader is displayed by the component rendered by the Route, not loadable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants