Get unlimited public & private packages + team-based management with npm Teams.Learn more »

react-decide

1.0.1 • Public • Published

react-decide

Commitizen friendly Build Status npm

React Component to make the Conditional Render look Elegant.

A Cleaner, Better way of writing conditional statements in React.

Installation

yarn add react-decide

or

npm install --save react-decide

Usage

<Decide>
    <If condition={false}>
        // Render on If Condition
    </If>

    <ElseIf condition={() => {
            //Do Something 
            return false;
        }}>
        // Render on ElseIf Condition
    </ElseIf>

    <Else>
        // Render on If Condition
    </Else>
</Decide>

Install

npm i react-decide

DownloadsWeekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

209 kB

Total Files

19

Last publish

Collaborators

  • avatar