the-condition
Conditional renderer for the-components
Installation
$ npm install the-condition --save
Usage
'use strict' PureComponent { const value = 1 return <div> <TheConditionStyle/> <TheCondition if=value === 1> <div>Will b render if the condition is true</div> <div>Can be multiple</div> </TheCondition> <TheCondition unless=value === 1> <div>Will be rendered unless the condition is true</div> <div>Can be multiple</div> </TheCondition> </div> }
Components
TheCondition
Conditional renderer for the-components
Props
Name | Type | Description | Default |
---|---|---|---|
allOf |
arrayOf bool | null |
|
if |
bool | null |
|
someOf |
arrayOf bool | null |
|
unless |
bool | null |
TheConditionStyle
Style for TheCondition
Props
Name | Type | Description | Default |
---|---|---|---|
options |
object | Style options | {} |
License
This software is released under the MIT License.