react-hook-toast
v0.0.4
Published
An easy toast hook built with react that you can use it outside react components.
Maintainers
Readme
React Toast by hooks
An easy toast hook built with react that you can use it outside react components.
Installation
npm install react-hook-toastimport useToast from "react-hook-toast";You need to import the css style
import "react-hook-toast/dist/style.css";Examples
import { useEffect } from "react";
import useToast from "react-hook-toast";
import "react-hook-toast/dist/style.css";
function App() {
const toast = useToast();
useEffect(() => {
toast({
title: "hi, this is a sample",
interval: 5000,
type: "success",
// type: "error"
// type: "warrning"
});
}, []);
return <></>;
}
export default App;