react-hook-toast
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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;

Package Sidebar

Install

npm i react-hook-toast

Weekly Downloads

354

Version

0.0.3

License

MIT

Unpacked Size

12.4 kB

Total Files

11

Last publish

Collaborators

  • shamouni