UNPKG

@shopify/polaris

Version:

Shopify’s admin product component library

15 lines (11 loc) 342 B
'use strict'; var React = require('react'); var context = require('./context.js'); function useListbox() { const listbox = React.useContext(context.ListboxContext); if (!listbox) { throw new Error('No Listbox was provided. Listbox components must be wrapped in a Listbox'); } return listbox; } exports.useListbox = useListbox;