mercredi 29 novembre 2017

React-native 0.49 CheckBox How to change the prop : value ?

I'm trying to understand how to change the value of a checkbox that is new in React-native 0.49.

            <CheckBox
            value = {this.state.value}
            onValueChange= {(value) => this.toggleCheckBox(value)}
            />

And this is my toggleCheckbox function

toggleCheckBox(data){
   this.setProps({
     value : data
});

The question is .. the function onValueChange only works once and once only. the toggleCheckBox is called only once also I cant figure out how to update the value of checkbox.




Aucun commentaire:

Enregistrer un commentaire