react-usemessage-hook

1.0.6 • Public • Published

A hook for activating message bar programmatically, based on Material-ui

Install

npm install react-usemessage-hook

Usage

import React, { useEffect } from "react";
 
function App() {
  const msg = useMessage();
  useEffect(() => {
    msg({
      type: "success", // success | warning | error | info
      msg: "Hello World",
      duration: "6000" // ms
    });
  }, []);
  return <></>;
}

Package Sidebar

Install

npm i react-usemessage-hook

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

5.45 kB

Total Files

5

Last publish

Collaborators

  • salmondaze