UNPKG

@trellixio/roaster-coffee

Version:
11 lines (10 loc) 395 B
import * as React from 'react'; export const ActionListContext = React.createContext(null); export const ActionListProvider = ActionListContext.Provider; export const useActionListContext = () => { const context = React.useContext(ActionListContext); if (context == null) { throw new Error('ActionList components must be wrapped in <ActionList />'); } return context; };