@@ -9,7 +9,6 @@ import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
99import ScreenWrapper from '@components/ScreenWrapper' ;
1010import ScrollView from '@components/ScrollView' ;
1111import useLocalize from '@hooks/useLocalize' ;
12- import usePrevious from '@hooks/usePrevious' ;
1312import useThemeStyles from '@hooks/useThemeStyles' ;
1413import { removeSplitExpenseField , updateSplitExpenseField } from '@libs/actions/IOU' ;
1514import { convertToDisplayString } from '@libs/CurrencyUtils' ;
@@ -71,7 +70,6 @@ function SplitExpenseEditPage({route}: SplitExpensePageProps) {
7170 } ) ,
7271 [ shouldShowTags , policy , policyTags , splitExpenseDraftTransaction ] ,
7372 ) ;
74- const previousTagsVisibility = usePrevious ( tagVisibility . map ( ( v ) => v . shouldShow ) ) ?? [ ] ;
7573
7674 return (
7775 < ScreenWrapper testID = { SplitExpenseEditPage . displayName } >
@@ -132,12 +130,14 @@ function SplitExpenseEditPage({route}: SplitExpensePageProps) {
132130 policyTagLists . map ( ( { name} , index ) => {
133131 const tagVisibilityItem = tagVisibility . at ( index ) ;
134132 const shouldShow = tagVisibilityItem ?. shouldShow ?? false ;
135- const prevShouldShow = previousTagsVisibility . at ( index ) ?? false ;
133+
134+ if ( ! shouldShow ) {
135+ return null ;
136+ }
136137
137138 return (
138139 < MenuItemWithTopDescription
139140 shouldShowRightIcon
140- highlighted = { shouldShow && ! getTagForDisplay ( splitExpenseDraftTransaction , index ) && ! prevShouldShow }
141141 key = { name }
142142 title = { getTagForDisplay ( splitExpenseDraftTransaction , index ) }
143143 description = { name }
0 commit comments