Open Jeyavijay opened 4 years ago
+1
I am not facing the error, but I can't use a FlatList/Swiper inside Carousel item.
I also tried using react-native-swipe-gestures library thinking that this might solve my issue.
I'm using FlatList
inside my carousel, and it is working fine.
Hello, i have the same problem with the last version. What's the solution ? in the old version that's work fine because we had to create carousel page with "View" not with data array.
Thanks for reply
Hello, i have the same problem with the last version. What's the solution ? in the old version that's work fine because we had to create carousel page with "View" not with data array.
Thanks for reply
Can you share the code?
Hello, In old version my Carousel was in export component where i could pass two array data :
In my export component "
<Carousel
ref={carousel}
renderIndicator={({ currentPage, index }) => (
<View
key={index}
style={{
width: 15,
height: 15,
borderRadius: 10,
marginTop: 10,
marginHorizontal: 5,
backgroundColor: currentPage === index ? "#36A9E1" : "#ccc",
}}
/>
)}
>
<View style={styles.carouselContainer}>
<FlatList
data={props.formations}
keyExtractor={item => item._id}
renderItem={({ item }) => (
<View style={styles.carouselItem}>
<View style={styles.containerIconInfo}>
<View style={styles.iconContainer}>
<FontAwesomeIcon
name="graduation-cap"
style={styles.icon}
></FontAwesomeIcon>
</View>
<View style={styles.info}>
<Text style={styles.jobName}>{item.formationId.nomFormation && item.formationId.nomFormation.length > 35 ? item.formationId.nomFormation.slice(0, 35) + '...' : item.formationId.nomFormation}</Text>
<Text style={styles.jobCompany}>{item.formationId.nomEtablissement && item.formationId.nomEtablissement.length > 35 ? item.formationId.nomEtablissement.slice(0, 35) + '...' : item.formationId.nomEtablissement}, Paris</Text>
<Text style={styles.jobYears}>
{moment(item.formationId.dateDebut).format('MMMM YYYY')} - {moment(item.formationId.dateFin).format('MMMM YYYY')}
</Text>
</View>
</View>
</View>
)}
/>
</View>
<View style={styles.carouselContainer}>
<FlatList
data={props.experiences}
keyExtractor={item => item._id}
renderItem={({ item }) => (
<View style={styles.carouselItem}>
<View style={styles.containerIconInfo}>
<View style={styles.iconContainer2}>
<FontAwesomeIcon
name="briefcase"
style={styles.icon}
></FontAwesomeIcon>
</View>
<View style={styles.info}>
<Text style={styles.jobName2}>{item.experienceId.nomPoste && item.experienceId.nomPoste.length > 35 ? item.experienceId.nomPoste.slice(0, 35) + '...' : item.experienceId.nomPoste}</Text>
<Text style={styles.jobCompany}>{item.experienceId.nomEntreprise && item.experienceId.nomEntreprise.length > 35 ? item.experienceId.nomEntreprise.slice(0, 35) + '...' : item.experienceId.nomEntreprise}, Paris</Text>
<Text style={styles.jobYears}>
{moment(item.experienceId.dateDebut).format('MMMM YYYY')} - {moment(item.experienceId.dateFin).format('MMMM YYYY')}
</Text>
</View>
</View>
</View>
)}
/>
</View>
</Carousel >
nobody for help ?
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
Hi
I'm trying to implement a Flat list inside a carousel view. But if I try to load a data the app crashes here is the screenshot . Is there a way to implement like this screen.
Thanks in advance.