@duodeka/notistack-helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@duodeka/notistack-helper

Makes displaying error toasts easier.

Example

import Notistack, { NotistackProvider } from "@duodeka/notistack-helper";
import ReactDOM from "react-dom/client";
import React from "react";

const App = () => {
  const handleErrorClick = () => Notistack.toast(new Error("Test"));
  const handleSuccessClick = () =>
    Notistack.toast("Everything is ok!", { variant: "success" });

  return (
    <>
      <button onClick={handleErrorClick}>Error</button>
      <button onClick={handleSuccessClick}>Success</button>
    </>
  );
};

ReactDOM.createRoot(element).render(
  <NotistackProvider>
    <App />
  </NotistackProvider>
);

Readme

Keywords

none

Package Sidebar

Install

npm i @duodeka/notistack-helper

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

64.5 kB

Total Files

7

Last publish

Collaborators

  • jdgjsag67251
  • koenlav
  • rikvdlooi