3.0.4 • Published 6 years ago

the-condition v3.0.4

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

the-condition

Build Status npm Version JS Standard

Conditional renderer for the-components

Installation

$ npm install the-condition --save

Usage

'use strict'

import React from 'react'
import { TheCondition, TheConditionStyle } from 'the-condition'

class ExampleComponent extends React.PureComponent {
  render () {
    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>

    )
  }
}

export default ExampleComponent

Components

TheCondition

Conditional renderer for the-components

Props

NameTypeDescriptionDefault
allOfarrayOf boolnull
ifboolnull
someOfarrayOf boolnull
unlessboolnull

TheConditionStyle

Style for TheCondition

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links