inf3cti0n95 / react-decide

React Component to make the Conditional Render look Elegant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-decide

Commitizen friendly Build Status codecov 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

Usage

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

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

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

About

React Component to make the Conditional Render look Elegant

License:MIT License


Languages

Language:JavaScript 100.0%