-
Notifications
You must be signed in to change notification settings - Fork 165
Add placeholder props #81
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
Conversation
What's up? |
Why not wrap the component with something else?
Lazy load is just supposed to load things once they hit the viewport I sort of feel like a placeholder should be handled by something else. Thoughts? |
We have a situation where we have a component that renders itself as a placeholder if no data or before data is fetched via an api. So initially before it fetches it will show itself with placeholders (for both text and image content in this component). So I'm just trying to think through how to do that either via the above suggestion or via some sort of placeholder mechanism in react-lazy-load. Just thinking out loud... Suppose we have some sort of Then I guess it will need to render both a placeholder and The user then scrolls down the page, sees the placeholder, and triggers the lazy load mechanism which triggers the api call. At that point it would not render the placeholder. This assumes that our component renders nothing whilst fetching. ... I'd have to try this I guess. But it feels like we are trying to work around the fact I'm not sure about the mechanism for specifying a placeholder component to |
So why is this not merged for half a year? |
@bf see above discussion. |
@loktar00 the obvious use case for me is to prevent page reflows when lazy-loading images. I'd like to maintain responsiveness of the container, which means that I can't just statically size the container element. Ideally, I'd be able to render a placeholder that uses an |
I added the placeholder props to the component !