reactjs - Adding custom elements on react native swiper tiles -
i using react-native-deck-swiper project, question how add custom parameters images, custom html elements tiles. there way add these cards array?
currently cards array structured like:
cards: ["1","2","3"]
is there way structure can pull in custom parameters so:
cards: [{name:"1", image:"imageurl", age:"43"},{name:"2", image:"imageurl", age:"22"}]
i appreciate help
you can make card
component, , pass data props:
const cards = [ { name: "1", image: "imageurl", age: "43" }, { name: "2", image: "imageurl", age: "22" }, ]; const card = props => <view> <image source={props.image} /> <text> {props.name}, {props.age} </text> </view>; <deckswiper cards={cards} rendercard={props => <card {...props} />} />;
wiki
Comments
Post a Comment