react-toastly-jsx
Version:
A beautiful React toast notification library with animations, gradients, sounds, and premium features for free.
11 lines (9 loc) • 332 B
JSX
import { useContext } from "react";
import { ToastlyContext } from "./ToastlyProvider"; // make sure this path matches your file structure
export function useToastly() {
const context = useContext(ToastlyContext);
if (!context) {
throw new Error("useToastly must be used within a ToastlyProvider");
}
return context;
}