Skip to content

Commit fb82b99

Browse files
authored
fix(vite): resolve Animated components (#322)
* fix(vite): resolve Animated components * fix: typo
1 parent e4688ed commit fb82b99

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Animated as RNAnimated } from 'react-native'
2+
import { FlatList } from './FlatList'
3+
import { Image } from './Image'
4+
import { ScrollView } from './ScrollView'
5+
import { SectionList } from './SectionList'
6+
import { Text } from './Text'
7+
import { View } from './View'
8+
9+
// source: https://github.com/necolas/react-native-web/tree/master/packages/react-native-web/src/vendor/react-native/Animated/components
10+
11+
export const Animated = {
12+
...RNAnimated,
13+
FlatList: RNAnimated.createAnimatedComponent((props) => <FlatList scrollEventThrottle={0.0001} {...props} />),
14+
ScrollView: RNAnimated.createAnimatedComponent((props) => <ScrollView scrollEventThrottle={0.0001} {...props} />),
15+
SectionList: RNAnimated.createAnimatedComponent((props) => <SectionList scrollEventThrottle={0.0001} {...props} />),
16+
Image: RNAnimated.createAnimatedComponent(Image),
17+
Text: RNAnimated.createAnimatedComponent(Text),
18+
View: RNAnimated.createAnimatedComponent(View),
19+
}

packages/uniwind/src/components/web/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from 'react-native'
22
export { ActivityIndicator } from './ActivityIndicator'
3+
export { Animated } from './Animated'
34
export { Button } from './Button'
45
export { FlatList } from './FlatList'
56
export { Image } from './Image'

0 commit comments

Comments
 (0)