@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
16 lines (15 loc) • 428 B
JavaScript
import invariant from 'invariant'
export default (list, value) => {
const whichProp = list.includes === void 0 ? 'has' : 'includes'
!list[whichProp](value)
? process.env.NODE_ENV !== 'production'
? invariant(
false,
'List ' +
JSON.stringify(list) +
' does not contain value: ' +
('' + JSON.stringify(value))
)
: invariant(false)
: void 0
}