/react-usemessage-hook

This is a react hook that activate message bar programmatically

Primary LanguageJavaScript

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

Install

npm install react-usemessage-hook

Usage

import React, { useEffect } from "react";
import useMessage from "react-usemessage-hook";

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