0.2.1 • Published 5 years ago

react-invariant v0.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

react-invariant

React component for invariant

Installation

npm i --save react-invariant
yarn add react-invariant

How to use?

import Invariant from 'react-invariant'

<Invariant condition={someTruthyVal} message="This will not show" />
// or
<Invariant condition={someFalseVal} message="This will show message in red text" />

Props:

PropDescription
conditionFalsey value to show the message
messageReact element or string to show when condition is falsey
classNamePass string of className
asstring to override default div tag. e.g span

It also supports HTMLElement props.

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago