Skip to content

React Component to make the Conditional Render look Elegant

License

Notifications You must be signed in to change notification settings

inf3cti0n95/react-decide

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published