1
I need to make a bind to a function that returns me if an item is marked or not, however the function that returns me this is only executed once, there is a way to bind to that function?
<List dataArray={this.state.talhoes}
renderRow={(talhao) =>
<TouchableOpacity onPress={() => this.select(talhao)}>
<Card>
<CardItem>
<Thumbnail square size={40} source={{ uri: talhao.public_url_screenshot }} />
<Text style={{ paddingLeft: 10 }} > {talhao.name} </Text>
<Right>
<CheckBox checked={this.checkSelected(talhao)} /> //Aqui o problema
</Right>
</CardItem>
</Card>
</TouchableOpacity>
}>
</List>
Have you tested
checked={this.checkSelected.bind(this, talhao)}
and then usecheckSelected(talhao, event){
?– Sergio
@Sergio doesn’t work, give me the answer that he expects a Boolean
– Felipe Paetzold
Felipe: I saw now that this checkbox is a component. What is the library? should have a
onChange
you can use like you were using with thechecked
. That onechecked
shall be the state of the componentpropType
requires to be aBoolean
..– Sergio