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.

🔥render completion callback?

See original GitHub issue

Hi! Great project 😃

My components are quite heavy and when I startup my app there are like 1.5 seconds where RLV hasn’t rendered yet and it appears blank, then suddenly pops in. Is there any way to know when RLV has rendered?

Something like an onLayout prop? I thought scrollViewProps might help but it didn’t work. If I can know when it rendered, I could implement some animations to make the RLV fade in smoothly.

Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:14

github_iconTop GitHub Comments

5reactions
josephmbeveridgecommented, Oct 23, 2019

Is it possible to re-open this issue? I really think it should be part of the RecyclerListView implementation as it is quite easy to have the list show nothing for up to 1 second while loading the content to render, even after the rest of the screen has rendered.

0reactions
fxcostacommented, May 31, 2021

I managed to do it as follow:

<RecyclerListView
  style={{
    minHeight: 1,
    minWidth: 1,
  }}
  forceNonDeterministicRendering
  canChangeSize
  rowRenderer={this.rowRenderer}
  dataProvider={messages}
  layoutProvider={this.layoutProvider}
  onItemLayout={e => {
    if (e >= messages.getSize() - 1) {
      this.setState({loadingMessages: false}); // HERE
      this.scrollView.scrollToEnd({animated: true});
    }
  }}
/>

I don’t know if it’s the best way and I’m not entirely satisfied with the result but at least I have a spinner on the screen until it renders the last message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Callback when all Template items finished rendering in Meteor?
My problem is that I have not found a way to query a state/fire a callback on the last item rendered aka the...
Read more >
renderedCallback() in Lightning Web Component
The renderedCallback() is unique to Lightning Web Components. Use it to perform logic after a component has finished the rendering phase.
Read more >
Hooks API Reference - React
The default behavior for effects is to fire the effect after every completed render. That way an effect is always recreated if one...
Read more >
Simplifying life with React render callbacks | by Adam Rackis
Now currentTime is just a function. It's a function which takes in a component, and then returns a NEW component whose only job...
Read more >
Avoiding Accidental Re-Renders with the useCallback Hook
With React hooks it's common to write callback functions in our ... In this lesson we start off by completing the conversion of...
Read more >

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