@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
26 lines (20 loc) • 651 B
JavaScript
var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault')
exports.__esModule = true
exports.default = void 0
var _invariant = _interopRequireDefault(require('invariant'))
var _default = (list, value) => {
const whichProp = list.includes === void 0 ? 'has' : 'includes'
!list[whichProp](value)
? process.env.NODE_ENV !== 'production'
? (0, _invariant.default)(
false,
'List ' +
JSON.stringify(list) +
' does not contain value: ' +
('' + JSON.stringify(value))
)
: invariant(false)
: void 0
}
exports.default = _default