Skip to content

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