Repository navigation
[perf] Migrate LHNOptionList to FlashList #31711
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
Changes from all commits
3a69621
b52995e
c94289a
3904226
a5f09fe
6a393f2
da1626c
963b4f1
48cddca
e18243f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| /* eslint-disable rulesdir/onyx-props-must-have-default */ | ||
| import PropTypes from 'prop-types'; | ||
| import React, {useCallback, useEffect, useRef} from 'react'; | ||
| import {InteractionManager, View} from 'react-native'; | ||
| import {InteractionManager, StyleSheet, View} from 'react-native'; | ||
| import _ from 'underscore'; | ||
| import LogoComponent from '@assets/images/expensify-wordmark.svg'; | ||
| import Header from '@components/Header'; | ||
|
|
@@ -177,16 +177,21 @@ function SidebarLinks({onLinkClick, insets, optionListItems, isLoading, priority | |
| </Tooltip> | ||
| <SignInOrAvatarWithOptionalStatus isCreateMenuOpen={isCreateMenuOpen} /> | ||
| </View> | ||
|
|
||
| <LHNOptionsList | ||
| style={[isLoading ? styles.flexShrink1 : styles.flex1]} | ||
| contentContainerStyles={[styles.sidebarListContainer, {paddingBottom: StyleUtils.getSafeAreaMargins(insets).marginBottom}]} | ||
| data={optionListItems} | ||
| onSelectRow={showReportPage} | ||
| shouldDisableFocusOptions={isSmallScreenWidth} | ||
| optionMode={viewMode} | ||
| /> | ||
| {isLoading && <OptionsListSkeletonView shouldAnimate />} | ||
| <View style={[styles.pRelative, styles.flex1]}> | ||
| <LHNOptionsList | ||
| style={styles.flex1} | ||
| contentContainerStyles={StyleSheet.flatten([styles.sidebarListContainer, {paddingBottom: StyleUtils.getSafeAreaMargins(insets).marginBottom}])} | ||
| data={optionListItems} | ||
| onSelectRow={showReportPage} | ||
| shouldDisableFocusOptions={isSmallScreenWidth} | ||
| optionMode={viewMode} | ||
| /> | ||
| {isLoading && optionListItems.length === 0 && ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really tried to find the root cause but i wasn't able to do it. I think the reason behind it might be the fact that when you turn off the internet connection on MacOS, the simulator still indicates that the network connection on the device is on (even if the message says you are offline). However that's just my guess, not having this issuse on other platforms is even stranger.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went through this problem together with @TMisiukiewicz and the reasoning makes sense to me. Flatlist behaved differently and 0px resulted with a 'ok UI state', whereas Flashlist just uncovered it as a bug. |
||
| <View style={[StyleSheet.absoluteFillObject, styles.highlightBG]}> | ||
| <OptionsListSkeletonView shouldAnimate /> | ||
| </View> | ||
| )} | ||
| </View> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
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 missing other data, e.g.
preferredLocalewhich caused the list not to re-render on language change