MOB-722 simplify types and string conversion

This commit is contained in:
sepeterson
2025-12-08 15:37:30 -06:00
parent 0867e76a04
commit 26608c0671
2 changed files with 4 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ const AdditionalSuggestionsScroll = ( {
// We're using an extra measuring container to check the heights of every item,
// even the ones that would otherwise be offscreen
const measuredItemsRef = useRef( new Set<number | string>() );
const measuredItemsRef = useRef( new Set<number>() );
const suggestionsRef = useRef<ApiSuggestion[]>( [] );
useEffect( () => {
@@ -42,7 +42,7 @@ const AdditionalSuggestionsScroll = ( {
measuredItemsRef.current = new Set();
}, [otherSuggestions] );
const updateMaxHeight = useCallback( ( height: number, itemId: number | string | undefined ) => {
const updateMaxHeight = useCallback( ( height: number, itemId?: number ) => {
if ( !itemId || height <= 0 ) return;
// track each item as measured
@@ -141,7 +141,7 @@ const AdditionalSuggestionsScroll = ( {
ListHeaderComponent={renderHeader}
horizontal
renderItem={renderItem}
keyExtractor={( item: ApiSuggestion ) => String( item?.taxon?.id )}
keyExtractor={( item: ApiSuggestion ) => `${item?.taxon?.id}`}
data={otherSuggestions}
/>
</View>

View File

@@ -48,7 +48,7 @@ const IconicSuggestionsScroll = ( {
ListHeaderComponent={renderHeader}
horizontal
renderItem={renderItem}
keyExtractor={( item: ApiTaxon ) => String( item?.id )}
keyExtractor={( item: ApiTaxon ) => `${item?.id}`}
data={iconicTaxa}
/>
</View>