If (component)

True conditionTrue condition

If

Download

npx github-download-directory carllosnc/cn-react-thekit src/components/If

Import

import { If, Else } from '@/components'

Usage

import { If, Else } from '@/components' function App() { const condition: boolean = 10 > 20 return ( <div> <If condition={true}> <span>True condition</span> </If> <If condition={false}> <span>True condition</span> </If> <If condition={condition}> <span>True condition</span> <Else> <span>False condition</span> </Else> </If> </div> ) }

Props

nametypedefaultdescription
conditionbooleanundefinedcondition to show or not
childrenReactElementundefinedcomponent children