UNPKG

@kirz/react-native-toolkit

Version:

Toolkit to speed up React Native development

19 lines 532 B
import { useCallback, useContext } from 'react'; import { AlertsContext } from '../contexts/AlertsContext'; export function useAlert() { const { showAlert: showAlertBase, hideAlert: hideAlertBase } = useContext(AlertsContext); const showAlert = useCallback((name, props) => { return showAlertBase(name, props); }, [showAlertBase]); const hideAlert = useCallback(name => { return hideAlertBase(name); }, [hideAlertBase]); return { showAlert, hideAlert }; } //# sourceMappingURL=useAlert.js.map