-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Implement FlatList everywhere #536
Conversation
Tested the Desktop build with @muttmuure -- what an improvement! Mobile performance is also good. For web I'm not being scrolled to the newest comment, but I'll review this again once the PR is complete.
From the FlatList docs, this seems to be a known trade-off
Perhaps getItemLayout might be of help here:
we would need to calculate height based on row data. This React snippet seems to achieve this with |
Thanks @Julesssss that snack snippet looks really cool. I tried it out on web, but the performance was noticeably worse than |
// This is the created action and the very first action so it cannot be a consecutive comment. | ||
if (actionIndex === 0) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not relevant anymore since I've added logic to remove all non comments before we get to this point
Co-authored-by: Andrew Gable <andrew@expensify.com>
if (_.size(prevProps.reportActions) !== _.size(this.props.reportActions)) { | ||
// If a new comment is added and it's from the current user scroll to the bottom otherwise | ||
// leave the user positioned where they are now in the list. | ||
if (lastItem(this.props.reportActions).actorEmail === this.props.session.email) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a few warnings got added here, can we prevent these?
'session' is missing in props validation
'session.email' is missing in props validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'll do a follow up to take care of these now.
Fixes: https://github.com/Expensify/Expensify/issues/141788
cc @Julesssss @AndrewGable @Jag96
Updated this solution to be
FlatList
only