Replies: 3 comments
-
🤖 Hey @cglacet! Great to see you diving into new adventures with the carousel 🎢 Unfortunately, server-side rendering (SSR) is not supported in React Native or its libraries such as react-native-reanimated-carousel. React Native is a framework for building native mobile apps, and it doesn't have the concept of a "server" in the same way that a web application does. The When porting your React Native app to the web using react-native-web, it's important to note that not all React Native libraries will work out of the box with react-native-web. Some libraries may require additional configuration or may not be compatible at all. In the case of I hope this information helps. If you have any other questions or need further clarification, feel free to ask. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
I tested the base example in reanimated and it seems to render properly on the server. |
Beta Was this translation helpful? Give feedback.
-
I was mistaking, export function NumberCarousel() {
return (
<Carousel
data={[1, 2, 3, 4]}
renderItem={({item}) => {
console.log('Carousel item', item);
return <NumberItem v={item} />;
}}
width={100}
height={100}
/>
);
}
function NumberItem({v}: {v: number}) {
console.log('Render number item', v);
return <Text>Item: {v}</Text>;
} This will print:
Instead of:
This obviously give the second output on the client side. |
Beta Was this translation helpful? Give feedback.
-
I have a react-native app that I'm porting to the web and I would like the content of the Carousel to be rendered on the server (SSR). For now it seems like the
renderItem
function is not called at all (and the HTML rendered is therefore empty).I'm using react-native-web (and Solito for the navigation part).
Note that I installed reanimated using this strategy Solito / Next.js Compatibility.
Any idea how I can achieve this?
Beta Was this translation helpful? Give feedback.
All reactions