react-native-toastier
Version:
A Fully Customizable Toast Component for React Native.
14 lines (10 loc) • 314 B
Flow
import { useContext } from "react";
import { ToastContext } from "../context/ToastProvider";
const useToast = () => {
const context = useContext(ToastContext);
if (!context) {
throw new Error('useToast must be used within a ToastProvider');
}
return context;
};
export default useToast;