@lad-tech/mobydick-core
Version:
React Native components library focused on usability, accessibility and developer experience
21 lines (15 loc) • 515 B
text/typescript
import {createContext} from 'react';
import {IPopupsContext} from './types';
const missingFunc = () => {
throw new Error(
'[@lad-tech/mobydick-core] usePopups hook was called outside of context, wrap your app with PopupsProvider component',
);
};
const PopupsContext = createContext<IPopupsContext>({
popups: [],
openPopup: missingFunc,
closePopup: missingFunc,
closeAllPopups: missingFunc,
});
PopupsContext.displayName = '@lad-tech/mobydick-core/PopupsContext';
export default PopupsContext;