Skip to content

pandeymangg/react-conditional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Conditional

A simple conditional component with support for fallback for your react projects.

Installation

npm

  npm i @pandeymangg/react-conditional

yarn

  yarn add @pandeymangg/react-conditional

Usage

  // Import in your project
  import { Conditional } from '@pandeymangg/react-conditional';

  export const Component = ({age}: {age: number}) => {
    return (
      <div>
        <Conditional
          condition={age > 13}
          fallback={
            <h1>You are not eligible!</h1>
          }
        >
          <h1>You are eligible!</h1>
        </Conditional>
    </div>
    )
  }

About

A simple conditional component for react apps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages