Placeholder if child is responsible for the progress
See original GitHub issueIf I am using an Image
wih rn-placeholder
like
<Placeholder.Media
size={60}
onReady={this.state.imageReady}
>
<Image source={img} onLoadEnd={() => this.setState({ imageReady: true })} />
</Placeholder.Media>
then the onLoadEnd
method doesn’t fire as Image
is not rendered yet. So how do we achieve something like this with the component inside is the one which is responsible for the fetching of the Image. I think this can be its own issue.
I did find a workaround though by using {position: 'absolute'}
<Placeholder.Media
size={60}
onReady={this.state.imageReady}
style={{position: 'absolute'}}
/>
<Image source={img} onLoadEnd={() => this.setState({ imageReady: true })} />
but the above mentioned looks like a hack. Not really, but still it would be helpful if this library rather than not rendering it must be just not showing like {display: 'none'}
. I didn’t check the source code but as onLoadEnd
is not firing I think its not rendering
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for providing these issue and information. I’m going to make some experiments and give you some feedbacks.
For now, I think the only solution is to do what you’re actually doing.
Nop 😞