UNPKG

@render-props/choices

Version:

A state container which provides an interface for making selections from a group of choices. The `Choices` component itself is a context provider which can be used with the `Choice` and `ChoicesConsumer` components for deep-tree selections. It does not ha

12 lines (9 loc) 276 B
import invariant from 'invariant' export default (list, value) => { const whichProp = list.includes === void 0 ? 'has' : 'includes' invariant( list[whichProp](value), `List ${JSON.stringify(list)} does not contain value: ` + `${JSON.stringify(value)}` ) }