react-simple-if

1.0.0 • Public • Published

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:

Props Type Description
exp boolean Style for root element

Dependents (0)

Package Sidebar

Install

npm i react-simple-if

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.18 kB

Total Files

7

Last publish

Collaborators

  • gauravchl