Open daniel031699 opened 5 years ago
I'm not certain what you mean. Do you want to show/hide buttons based on the component's state itself?
If so, keep in mind that you are essentially adding objects to an array. You could do something as simple as:
mySwipeoutButtons = [
{
text: 'Remove',
onPress: () => console.log('removing item')
},
{
text: 'Mark Done',
onPress: () => console.log('marking item as done')
},
];
if (state.isEditable) {
mySwipeoutButtons.push({
text: 'Edit',
onPress: () => console.log('editing item'),
});
}
i want to hidden button use different state![image](https://user-images.githubusercontent.com/15700134/45663412-d7ed0e80-bb38-11e8-952d-8e6afbb82334.png)