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

Bug with delay when the component is already mounted #54

Closed
ghost opened this issue Oct 30, 2017 · 2 comments
Closed

Bug with delay when the component is already mounted #54

ghost opened this issue Oct 30, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 30, 2017

If you set a delay and the component is already mounted, when you set ready to false, it will use the same delay to start showing the placeholder. I want to start showing the placeholder immediately after setting ready to false.

I believe don't need to check the delay to set the state ready to false here:
https://github.com/buildo/react-placeholder/blob/master/src/ReactPlaceholder.js#L63

Am I wrong?

@ghost
Copy link
Author

ghost commented Oct 30, 2017

It seems to be a misunderstanding, I thought the delay was to keep the placeholder for a while, to avoid the blinking content with fast connections. By the way, the delay is to wait some time to show the placeholder, anyway I can't see a use case for that.

@ghost ghost closed this as completed Oct 30, 2017
@gabro
Copy link
Member

gabro commented Oct 30, 2017

It's exactly the opposite solution to the same problem :)

The delay delays the appearance of the placeholder in case of a fast connection. This way if your content loads fast you can skip the placeholder altogether and avoid the blinking.

This issue was closed.
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

1 participant