-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Describe the bug
After I upgraded to 0.81.0 and added the babel configuration of 'nativewind/babel', the project would report an error when using the FlatList component in react-native-gesture-handler or the Animated in react-native-reanimated.
software-mansion/react-native-gesture-handler#3675
software-mansion/react-native-reanimated#8087
Reproduction
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { FlatList, GestureHandlerRootView } from 'react-native-gesture-handler';
const DATA = [
{ id: '1', text: 'Item 1' },
{ id: '2', text: 'Item 2' },
{ id: '3', text: 'Item 3' },
{ id: '4', text: 'Item 4' },
{ id: '5', text: 'Item 5' },
];
const App = () => {
return (
<GestureHandlerRootView style={styles.container}>
<FlatList
data={DATA}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<View style={styles.listItem}>
<Text style={styles.text}>{item.text}</Text>
</View>
)}
/>
</GestureHandlerRootView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 50,
},
listItem: {
padding: 20,
margin: 2,
backgroundColor: '#f8f8f8',
borderBottomWidth: 1,
borderColor: '#eee',
},
text: {
fontSize: 18,
},
});
export default App;
- StackBlitz template: https://stackblitz.com/edit/nativewind-test?view=editor
- Create Expo Stack template:
npm i [email protected]
add 'nativewind/babel' to babel
If you have a usage question, please use the Discord or GitHub Discussions instead.
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here. If applicable, add screenshots to help explain your problem.