1.0.1 • Published 3 years ago

rencond-react v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

RenCond-React

Conditional Render React Component with Typescript

How to use

Yo can install the package directly using the Node Package Manager

npm install rencond-react

Usage

The component have 5 attributes:

AttributeRequire?DescriptionType
ComponentIfYesThe functional component that would render if the If condition is TrueReact FC
ComponentElseNoThe functional component that would render if the If condition is FalseReact FC
RenderIfYesCondition used for the render of the componentboolean
ComponentIfPropsNoProps you can send to the If Componentany
ComponentElsePropsNoProps you can send to the Else Componentany

Import

import RenCond from 'rencond-react'

Use

<RenCond
 ComponentIf={someComponent}
 RenderIf={condition}
/>

Example

Simple example of the usage

Code (Example)

Code Example