Open sudonitin opened 4 years ago
I am facing same issue
Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2
I was having the same issue and couldn't make it work in one project. But was able to make it work in my new project. I followed this guide. https://amanhimself.dev/blog/custom-preview-image-gallery-in-react-native/
. I tried solutions suggested by others where they set the app name inside the package.json and then set the file path based on that app name but that did not work for me.
I fixed this problem by change the image source
const data = [
{ id:"1", image: require('filepath') },
{ id:"2", image: require('filepath') },
{ id:"3", image: require('filepath') },
];
const renderItem = ({ item }) => {
return (
<View style={styles.slide}>
<Image source={item.url} style={styles.image} />
</View>
);
};
In your Carousel component, set data={data}
and renderItem={renderItem}
.
Could not find an issue or instruction in the readme on how to use local images in the carousel.