1.0.0 • Published 5 years ago

react-simple-if v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

react-simple-if npm npm

A simple react component(just 109 Byte) for conditional rendering without ternary expression inside jsx;

Install:

npm install react-simple-if

Use:

import If from 'react-simple-if';
const foo = true;

// render hello world
<If exp={foo} />
    <p>Hello world<p>
</If> 

// Does not render hello world
<If exp={!foo} />
    <p>Hello world<p>
</If> 

Props:

PropsTypeDescription
expbooleanStyle for root element