Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MenuOptions to work with false childrens #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ancyrweb
Copy link

@ancyrweb ancyrweb commented Dec 19, 2016

Such code won't work :

<MenuOptions>
  <MenuOption value={"optionA"}>
    <Text>Option A</Text>
  </MenuOption>
  {(shouldDisplay => {
    if(!shouldDisplay){
      return false;
    }

    return (
      <MenuOption value={"optionB"}>
        <Text>Option B</Text>
      </MenuOption>
    )
  })(false)}
</MenuOptions>

I needed to render a MenuOption if a certain condition was met. So I implemented this solution to solve this problem.

@ancyrweb
Copy link
Author

@jaysoo anything on this please ?

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

Successfully merging this pull request may close these issues.

1 participant