react-native-reanimated-carousel
react-native-reanimated-carousel copied to clipboard
the carousel is un working
Describe the bug 插件未生效
To Reproduce Steps to reproduce the behavior: null
Expected behavior null
Screenshots
Source Code
import * as React from 'react';
import { Dimensions, Text, View } from 'react-native';
import Carousel from 'react-native-reanimated-carousel';
function Index() {
const width = Dimensions.get('window').width;
const [data, setData] = React.useState<number[]>([1, 2, 3, 4]);
return (
<View style={{ marginBottom: 30 }}>
<Carousel
loop
style={{
backgroundColor: '#333333',
}}
width={width}
height={width / 2}
autoPlay={true}
data={data}
scrollAnimationDuration={1000}
onSnapToItem={(index) => console.log('current index:', index)}
renderItem={({ index }) => (
<View
style={{
flex: 1,
borderWidth: 1,
justifyContent: 'center',
}}
>
<Text style={{ textAlign: 'center', fontSize: 30, color: '#ffffff' }}>
index
</Text>
</View>
)}
/>
</View>
);
}
export default Index;
Versions (please complete the following information):
- react: v18.2.0
- react-native: v0.71.6
- react-native-reanimated: v3.1.0
- react-native-reanimated-carousel: v3.3.2
- react-native-gesture-handler: v2.9.0
Smartphone (please complete the following information):
- Device: [e.g. iPhone12]
- OS: [e.g. iOS16.0]
Additional context null
I encountered the same problem:
react: v17.0.2 react-native: v0.66.1 react-native-reanimated: v3.1.0 react-native-reanimated-carousel: v3.3.2 react-native-gesture-handler: v1.8.0
I'm facing the same problem whenever I'm enable the Chrome Debugger in Simulator and Android Device. It's working without debugger.