11import React , { memo , useMemo } from 'react'
22import type { ListRenderItem } from 'react-native'
33import { StyleSheet , FlatList , View , useColorScheme } from 'react-native'
4- import * as Animatable from 'react-native-animatable'
5- import { fadeInDownShort , fadeInUpShort } from './helpers'
4+ import Animated from 'react-native-reanimated'
65import { theme as defaultTheme } from './theme'
76import type { AutocompleteDropdownItem , IAutocompleteDropdownProps } from './types'
7+ import { FadeInDown , FadeInUp , FadeOutDown , FadeOutUp } from './helpers'
88interface DropdownProps extends Omit < IAutocompleteDropdownProps , 'renderItem' | 'ref' > {
99 ListEmptyComponent : React . ReactElement
1010 renderItem : ListRenderItem < AutocompleteDropdownItem >
@@ -30,12 +30,9 @@ export const Dropdown = memo((props: DropdownProps) => {
3030 } , [ styles . itemSeparator ] )
3131
3232 return (
33- < Animatable . View
34- useNativeDriver
35- animation = { direction === 'up' ? fadeInUpShort : fadeInDownShort }
36- easing = "ease-out-quad"
37- delay = { direction === 'up' ? 150 : 0 }
38- duration = { 150 }
33+ < Animated . View
34+ entering = { direction === 'up' ? FadeInUp : FadeInDown }
35+ exiting = { direction === 'up' ? FadeOutUp : FadeOutDown }
3936 style = { {
4037 ...styles . listContainer ,
4138 ...( rest . suggestionsListContainerStyle as object ) ,
@@ -52,7 +49,7 @@ export const Dropdown = memo((props: DropdownProps) => {
5249 ItemSeparatorComponent = { ItemSeparatorComponent ?? defaultItemSeparator }
5350 { ...rest . flatListProps }
5451 />
55- </ Animatable . View >
52+ </ Animated . View >
5653 )
5754} )
5855
0 commit comments