react-simple-if
v1.0.0
Published
A simple react component(just 109 Byte) for conditional rendering without ternary expression inside jsx;
Downloads
3
Maintainers
Readme
react-simple-if
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:
Props | Type | Description ------|------ | ------------- exp | boolean | Style for root element