Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

how can i hidden the button according different state #297

Open
daniel031699 opened this issue Sep 18, 2018 · 1 comment
Open

how can i hidden the button according different state #297

daniel031699 opened this issue Sep 18, 2018 · 1 comment

Comments

@daniel031699
Copy link

i want to hidden button use different state
image

@lucascordina
Copy link

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'),
      });
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants