I am looping over an array and everytime the text at the index is clicked , i get it printed but i am using bind everytime .How can we do it without bind and just es6.
for(let index=1;index<=10;index++){
arr.push(
<TouchableOpacity
activeOpacity={0.7}
key={index}
onPress={this.Updatefunction.bind(this, index)}
>
<Text>
{index}
</Text>
</TouchableOpacity>
);
}
i want to access the index but don't want to do binding.