Getting Started
Notifications
useink/notifications
is an extension of useink
that provides an opinionated state management system for tracking the changing status of a transaction. When you add a notification it will live until the configured time to live has expired then will automatically be removed from state. This is useful for temporarily displaying a notification then having it removed in the view. useink/notifications
does not contain any UI elements. It only tracks state. You can use this in combination with UI libraries or components of your choice.
Installation
You must first install useink. useink/notifications
has its own import path in the
Configure tsconfig.json
You must set moduleResolution
to nodenext
or bundler
. This feature allows your application to discover the useink/notifications
import paths defined in the useink package.json
.
Add NotificationsProvider
Notification state management is not in useink by default. You must wrap your application with <NotificationsProvider>
.
Configuring Notifications
If you want Notifications to live in state for ever, or until you remove them you can set the
See configuration to learn about custom and default settings.
Last updated
Was this helpful?