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

Delay children mounting on Loading boxLoader type #396

Open
bvego opened this issue Sep 28, 2018 · 0 comments
Open

Delay children mounting on Loading boxLoader type #396

bvego opened this issue Sep 28, 2018 · 0 comments
Labels
Bug Something isn't working

Comments

@bvego
Copy link

bvego commented Sep 28, 2018

Is your feature request related to a problem? Please describe.
When using the <Loader type="boxLoader" ...>... it attempts to mount the children. This is very annoying in the following use case if some of the data that the children need to access isn't available. E.G. data is null/undefined/an empty array...

<Loader loading={fetchingSomeDetails} type="boxLoader" text="Loading">
  <div>{detailsThatAreSupposedToBeFetched.someProperty}</div>
</Loading>

Describe the solution you'd like
Check the loading prop to calculate whether or not to mount the children if type="boxLoader" or maybe pass a prop that will do this functionality

Describe alternatives you've considered
For now we use the following to delay the content:

<Loader loading={fetchingSomeDetails} type="boxLoader" text="Loading">
  {detailsThatAreSupposedToBeFetched && (
    <div>{detailsThatAreSupposedToBeFetched.someProperty}</div>
  )
</Loading>

It would reduce some code if this was done by the component itself

@vepor vepor added the Bug Something isn't working label Oct 10, 2018
@vepor vepor self-assigned this Mar 13, 2019
@vepor vepor removed their assignment Oct 22, 2019
@vepor vepor removed the Postponed label Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants