99.10.0 • Published 4 years ago

@temporg/ui-prop-types v99.10.0

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

category: packages

ui-prop-types

npm  build-status  MIT License  Code of Conduct

A collection of custom prop type validators.

Functions

The ui-prop-types package contains the following:

Installation

yarn add @temporg/ui-prop-types

Usage

import React from 'react'
import PropTypes from 'prop-types'

import { Children, controllable } from '@temporg/ui-prop-types'

class MyComponent extends React.Component {
  static propTypes = {
    children: Children.oneOf([SomeOtherComponent, AnotherComponent])
    selected: controllable(PropTypes.bool, 'onSelect'),
    onSelect: PropTypes.func
  }
  ...
}