JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 120
  • Score
    100M100P100Q72684F
  • License MIT

A simpler MUI Toast

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mui-simple-toast) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    mui-simple-toast - Simplified toaster/snackbar for MUI

    A Simpler MUI Toast.

    How to use?

    1. import { MUISimpleToast, ToastContext } from 'mui-simple-toast'
    2. In your component,
    const { setToast } = useContext(ToastContext)

    and Set toaster using seToast

    Example on API Call:

    fetch(url)
    .then(() => setToast({
        show: true,
        type: 'success',
        message: 'Success!',
    }))
    .catch(err => setToast({
        show: true,
        type: 'error',
        message: err?.message || '',
        }))
    

    In return method of component, add <MUISimpleToast />