0.0.3 • Published 9 months ago

react-hook-toast v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

React Toast by hooks

An easy toast hook built with react that you can use it outside react components.

Installation

 npm install react-hook-toast
import 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",
      type: "success",
      interval: 5000,
      // type: "error"
      // type: "warrning"
    });
  }, []);

  return <div className="container"></div>;
}

export default App;