Closed StefSchalks closed 4 months ago
Hey @StefSchalks! I'm here to help you with any issues or questions you have. I can assist with bug fixes, code improvements, and more. Let me know how I can help!
Yes, it is possible to create nested horizontal carousels using the react-native-reanimated-carousel
library. Here are some best practices and configurations to ensure smooth functionality:
flex: 1
to ensure that the carousel takes up the available space within its parent container.width
and height
for the carousel to ensure it renders correctly.alignItems
and justifyContent
to center the carousel items.Here is an example configuration:
<View style={{ flex: 1 }}>
<Carousel
style={{
width: "100%",
height: 240,
alignItems: "center",
justifyContent: "center",
}}
width={280}
height={210}
pagingEnabled={true}
snapEnabled={true}
mode="horizontal-stack"
loop={true}
autoPlay={false}
autoPlayReverse={false}
data={[...new Array(6).keys()]}
modeConfig={{
snapDirection: "left",
stackInterval: 18,
}}
customConfig={() => ({ type: "positive", viewCount: 5 })}
renderItem={({ index }) => (
<SBItem
index={index}
key={index}
entering={FadeInRight.delay((5 - index) * 100).duration(200)}
/>
)}
/>
</View>
This configuration ensures that the carousel is centered and takes up the appropriate amount of space within its container [1].
To continue talking to Dosu, mention @dosu.
Hey, I've been digging into this library a bit lately and it works pretty well. There's one thing that I'm wondering. For my implementation, I need two nested horizontal carousels (something like this: https://naver.github.io/egjs-flicking/Demos#nested-flickings). I'd appreciate to hear if this is possible or not. Thanks in advance.