reactjs-condition
v0.1.1
Published
React conditional rendering more friendly way
Downloads
3
Readme
React Condition
React conditional rendering more friendly way
how it's works
import { If } from 'react-condition'
<If condition={false}>
<div>TRUE</div>
</If>
import { If, Else } from 'react-condition'
<If condition={false}>
<div>TRUE</div>
<Else />
<div>FALSE</div>
</If>
import { If, ElseIf, Else } from 'react-condition'
const fruit = 'Apple'
<If condition={fruit === 'Apple'}>
<div>Apple</div>
<ElseIf condition={fruit === 'Orange'} />
<div>Orange</div>
<Else />
<div>Banana</div>
</If>