0.1.1 • Published 6 years ago
reactjs-condition v0.1.1
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>
0.1.1
6 years ago