Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { Container, Content, List, Body, ListItem, Text, CheckBox } from 'native-base';
  3.  
  4. class ListExample extends Component {
  5. state = {
  6. pressed: true,
  7. value: ""
  8. };
  9.  
  10. onCheckBoxPress() {
  11. console.log(this);
  12. this.setState({ pressed: false});
  13. this.setState({ value: BODYVALUE});
  14. }
  15.  
  16. render() {
  17. var items = [ "test1", "test2", "test3", "test4", "test5", "test6" ];
  18. return (
  19. <Container>
  20. <Content>
  21. <List dataArray={items} renderRow={(data) =>
  22. <ListItem>
  23. <CheckBox onPress={this.onCheckBoxPress.bind(this)} checked={this.state.pressed} />
  24. <Body>
  25. <Text>{data}</Text>
  26. </Body>
  27. </ListItem>
  28. } />
  29. </Content>
  30. </Container>
  31. );
  32. }
  33. }
  34.  
  35. export default ListExample;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement