npm.io
99.10.0 • Published 6 years ago

@temporg/ui-prop-types

Licence
MIT
Version
99.10.0
Deps
2
Size
59 kB
Vulns
0
Weekly
0

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
  }
  ...
}