1
1
import React , { memo , useMemo } from 'react'
2
2
import type { ListRenderItem } from 'react-native'
3
3
import { 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'
6
5
import { theme as defaultTheme } from './theme'
7
6
import type { AutocompleteDropdownItem , IAutocompleteDropdownProps } from './types'
7
+ import { FadeInDown , FadeInUp , FadeOutDown , FadeOutUp } from './helpers'
8
8
interface DropdownProps extends Omit < IAutocompleteDropdownProps , 'renderItem' | 'ref' > {
9
9
ListEmptyComponent : React . ReactElement
10
10
renderItem : ListRenderItem < AutocompleteDropdownItem >
@@ -30,12 +30,9 @@ export const Dropdown = memo((props: DropdownProps) => {
30
30
} , [ styles . itemSeparator ] )
31
31
32
32
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 }
39
36
style = { {
40
37
...styles . listContainer ,
41
38
...( rest . suggestionsListContainerStyle as object ) ,
@@ -52,7 +49,7 @@ export const Dropdown = memo((props: DropdownProps) => {
52
49
ItemSeparatorComponent = { ItemSeparatorComponent ?? defaultItemSeparator }
53
50
{ ...rest . flatListProps }
54
51
/>
55
- </ Animatable . View >
52
+ </ Animated . View >
56
53
)
57
54
} )
58
55
0 commit comments