React Condition works with React Hooks as part of @leebyron's React Velcro architecture
npm install react-conditionReact Condition works with React Hooks as part of @leebyron's React Velcro architecture
``sh`
$ yarn add react-condition
`sh`
$ npm i react-condition
Use the test prop with and elements to conditionally include certain elements. When an test is _truthy_ it does not render any or children. However when it is _falsey_ it _only_ renders and children.
`js`
This will only be shown if someCondition is truthy.
This will only be shown if someCondition is falsey
and otherCondition is truthy.
This will only be shown if both someCondition and
otherCondition are both falsey.
This will be shown if someCondition is falsey.
This will be shown if someCondition is falsey
and finalCondition is truthy.
Alternatively, you can provide then and else props.
`js`
then={"This will only be shown if someCondition is truthy."}
else={"This will be shown if someCondition is falsey."}
/>
Use the expression prop with element to conditionally include certain elements. When an compares a value from and the comparison is _truthy_ it _only_ renders the matching child. However, when the comparison is _falsey_ it continues through the children until it finds a match, or falls back to .
`js`
red
green
blue
`js`
red
green
blue
no color
Alternatively, you can provide then as props to or
`js``
@leebyron/react-loops - The father (or mother, idfk) of this library