Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { Container, Content, List, Body, ListItem, Text, CheckBox } from 'native-base';
- class ListExample extends Component {
- state = {
- pressed: true,
- value: ""
- };
- onCheckBoxPress() {
- console.log(this);
- this.setState({ pressed: false});
- this.setState({ value: BODYVALUE});
- }
- render() {
- var items = [ "test1", "test2", "test3", "test4", "test5", "test6" ];
- return (
- <Container>
- <Content>
- <List dataArray={items} renderRow={(data) =>
- <ListItem>
- <CheckBox onPress={this.onCheckBoxPress.bind(this)} checked={this.state.pressed} />
- <Body>
- <Text>{data}</Text>
- </Body>
- </ListItem>
- } />
- </Content>
- </Container>
- );
- }
- }
- export default ListExample;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement