category: packages
ui-prop-types
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
}
...
}