Closed anastely closed 5 years ago
Oops. Looks like the readme and examples haven't been properly updated for version 3.0.0. You would need to unpack the arguments for your renderItem
-function like so:
_renderItem = ({ item }) => {
return (
<View style={styles.mainContent}>
<Text>Hello</Text>
{/* <Image
resizeMode="center"
style={styles.image}
source={require("../assets/2.png")}
/> */}
<Text style={styles.title}>{item.title}</Text>
<Image style={styles.image} source={item.image} />
<Text style={styles.text}>{item.text}</Text>
</View>
);
};
Yeah, That's work, and rendering everything but backgroundColor
in every slide couldn't work :/
That's because you didn't specify a backgroundColor anywhere in your render function. I expect you would probably want to do something like
_renderItem = ({ item }) => {
return (
<View style={[styles.mainContent, { backgroundColor: item.backgroundColor }]}>
<Text>Hello</Text>
{/* <Image
resizeMode="center"
style={styles.image}
source={require("../assets/2.png")}
/> */}
<Text style={styles.title}>{item.title}</Text>
<Image style={styles.image} source={item.image} />
<Text style={styles.text}>{item.text}</Text>
</View>
);
};
Hey, i have some issue when i use the example in the Repo,
so it's not Rendering anything else a "Button"
https://i.imgur.com/XWBa8Mr.png
Code