question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Placeholder if child is responsible for the progress

See original GitHub issue

If 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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mfrachetcommented, Nov 19, 2017

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.

0reactions
mfrachetcommented, Oct 2, 2018

Nop 😞

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found