npm.io
10.30.0 • Published 4 months ago

@instructure/ui-prop-types

Licence
MIT
Version
10.30.0
Deps
2
Size
182 kB
Vulns
0
Weekly
0
Stars
478

ui-prop-types

npm MIT License Code of Conduct

A collection of custom prop type validators.

Functions

The ui-prop-types package contains the following:

Installation
npm install @instructure/ui-prop-types
Usage
import React from 'react'
import PropTypes from 'prop-types'

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

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