Include button prop with <CardItem> to achieve onClick function with card items.
Syntax
import React, { Component } from 'react';
import React, { Component } from "react";
import { Container, Header, Title, Content, Button, Icon, Card, CardItem, Text, Body, Left, Right, IconNB } from "native-base";
export default class CardItemButton extends Component {
render() {
return (
<Container>
<Header>
<Left>
<Button transparent>
<Icon name="arrow-back" />
</Button>
</Left>
<Body>
<Title>Card Item Button</Title>
</Body>
<Right />
</Header>
<Content padder>
<Card>
<CardItem header button onPress={() => alert("This is Card Header")}>
<Text>NativeBase</Text>
</CardItem>
<CardItem button onPress={() => alert("This is Card Body")}>
<Body>
<Text>
Click on any carditem
</Text>
</Body>
</CardItem>
<CardItem footer button onPress={() => alert("This is Card Footer")}>
<Text>GeekyAnts</Text>
</CardItem>
</Card>
</Content>
</Container>
);
}
}
