@trellixio/roaster-coffee
Version:
Beans' product component library
11 lines (10 loc) • 395 B
JavaScript
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;
};