Breaking changes
Notification
- The
Notification.closeButton
attribute was renamedNotification.showDismissButton
- The
Notification.onRemove
was renamedNotification.onDismiss
- The
default
notification status was renamednone
. - The
STATUS
constant was renamedSTATUSES
- The position
top
andbottom
were removed.
Actions
- Notifications have no default properties by default
- Default properties of notifications are not configurable via the reducer function anymore.
- The action
removeNotification
was renameddismissNotification
- The action
notify
now returns a redux action instead of the notification. - The action
removeNotification
was renameddismissNotification
- The action
removeNotifications
was renameddismissNotifications
- Images specified in
Notification.image
won't be preloaded anymore. You need to preload them before creating/updating notifications. - HTTP status codes passed in
Notification.status
won't be converted anymore to statuses supported by the library. - all Redux actions are not exposed under the
actions
variable.
Components
- The component
NotificationsSystem
requiresnotifications
, anddismissNotification
properties. - The
filter
property of theNotificationsSystem
component was removed. Use instead thenotification
property. - Themes are not directly included in this package and build with inline CSS.
Migration guide
- Replace usage of
Notification.closeButton
withNotification.showDismissButton
- Replace usage of
Notification.onRemove
withNotification.onDismiss
- Replace usage of
STATUS
withSTATUSES
- Replace usage of
STATUSES.default
withSTATUSES.none
ornull
. - Use the
top-center
orbottom-center
position if you used thetop
orbottom
position - Remove default properties passed to the notifications reducer and use the
setUpNotifications
helper to set up the default properties of your notifications. - Update
notify(...)
call to get the notification from thepayload
property of the action returned (previously the notification was returned) - Replace usage of
addNotification
andupdateNotification
actions withnotify
- Replace usage of
removeNotification
action withdismissNotification
- Replace usage of
removeNotifications
action withdismissNotifications
- Make sure to preload images before creating/updating notifications containing images.
- Replace statements where you set HTTP status code in
Notification.status
, or set acustomizeNotification
function with thesetUpNotifications
helper to reproduce this behavior - Replace usage of
reapop.actions
and directly importnotify
,dismissNotification
ordismissNotifications
fromreapop
- Add
notifications
anddismissNotification
property to theNotificationsSystem
component. Read the Integration & usage section to learn more about these new properties. - Remove
filter
property of theNotificationsSystem
component. - Replace usage of
reapop-theme-*
package with builtin themes. More information in the Themes section of the documentation to get these themes. - If you have a custom theme, read the guide to create a custom theme with a CSS file to learn how to migrate your theme. If you prefer inline CSS, or CSS-in-JS, you might want to take a look at create a custom theme with inline CSS
New
- Compatible with any application state managers. You can use it with mobx for example.
- TypeScript types exposed
- new API using React hooks and the React context API to use the library with React only
- New builtin transitions: fade, grow, slide
- Customizable components:
Transition
,NotificationIcon
, andNotification
- new API to create custom themes (inline CSS or CSS files)
- new helper function to:
- define default properties for notifications
- define a custom function used to modify notifications
- define the function used to generate notification IDs
More information about these new things in the documentation
Improvements
- Complete rewrite in TypeScript
- removed non-customizable behaviors
- removed
redux-thunk
dependency
If you have any questions or feedback, feel free to open an issue 🙂