lundi 2 juillet 2018

How to check checkbox when there is an array in React Native?

I just want to get checked friends using checkbox. But I don't know what to do.

Can you help please

This is my state

state = {checked: false}

This is where I want to map array

{this.props.navigation.getParam('friends').map((name, key) => (
<View>
  <Text>{name}</Text>
  <CheckBox 
    checked={this.state.checked}
    onPress={(val)=>{}}
  />
</View>))}




Aucun commentaire:

Enregistrer un commentaire