Package Exports
- react-sweet-notification
- react-sweet-notification/dist/index.js
- react-sweet-notification/dist/index.mjs
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 (react-sweet-notification) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-sweet-notification
A BEAUTIFUL, RESPONSIVE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR REACT NOTIFY BOXES ZERO DEPENDENCIES
Install
npm install react-sweet-notification
# or, if using yarn
yarn add react-sweet-notification
Usage
import { NotifyProvider, toast, confirm } from "react-sweet-notification";
function App() {
const showToast = () => {
toast();
};
const showConfirm = () => {
confirm();
};
return (
<div>
<NotifyProvider />
<button onClick={showToast}>toast me</button>
<button onClick={showConfirm}>confirm</button>
</div>
);
}
When using the next.js framework, import the
import dynamic from "next/dynamic";
const NotifyProvider = dynamic(
() => import("react-sweet-notification").then((mod) => mod.NotifyProvider),
{
ssr: false,
}
);
component in this way
License
Licensed under MIT