react-conditionals

0.0.1 • Public • Published

React Conditionals

Conditional components for React using JSX - Demo

Examples

If else

<If condition={this.state.age >= 18}>
  <Then>
    You can drink in the UK!
  </Then>
  <Else>
    You can't drink in the UK...
  </Else>
</If>

Note: This can also be used without an else component

If without an else

<If condition={this.state.errors}>
  <Then>
    {this.state.errors}
  </Then>
</If>

Package Sidebar

Install

npm i react-conditionals

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • jakesidsmith