- The library now internally uses
react-native-safe-area-context. Make sure you havereact-native-safe-area-contextinstalled, and thatNotifierRoot/Wrapperis wrapped bySafeAreaProvider. Componentis unmounted while the notification is not visible.containerStylenow only accepts a simple style object and cannot be used to change animation. UseanimationFunctioninstead.- The "Hide Timer" (
durationparam) now starts after the “appearing” animation finishes, rather than when it starts. If you use a long “appearing” animation, you may want to reduce theduration(3 seconds by default). - The
swipeEnabledparameter has been removed. To disable swipes, setswipeDirection: 'none'. - The parameters
animationDuration,showAnimationDuration,hideAnimationDuration,swipeAnimationDuration,easing,showEasing,hideEasing,swipeEasinghave been removed. UseshowAnimationConfig,hideAnimationConfig,swipeOutAnimationConfig,resetSwipeAnimationConfiginstead. - The default
showAnimationConfigis now set to a spring animation whenComponent != NotifierComponents.Alert.
- Support for different positions. A notification can be placed at
top,bottom, or any edge of the screen using thepositionparameter. - Introduced new params:
enterFrom,exitTo, andswipeDirection. These control the direction of entering/exiting animations and allow swiping not only to the top but also left, right, and down. - New
animationFunctionparameter for creating custom animations. - Each notification now has its own ID. The default ID depends on the
idStrategyparameter, and you can also assign one manually. If a notification with the same ID is already shown, the result ofshowNotificationdepends onduplicateBehavior. - New
duplicateBehaviorparameter describing how the Notifier should behave if a notification with the same ID is already shown. - New
idStrategyparameter, which defines how a default ID is generated if none is provided. - New
updateNotificationmethod that updates a currently visible notification. - New
shakeNotificationmethod that shakes a currently visible notification to attract the user's attention and optionally resets thedurationtimer. - New
isNotificationVisiblemethod: Returns a boolean indicating if any notification is currently visible. - New methods:
updateById,shakeById,isVisibleById, andhideById. These methods only affect a notification if the provided ID matches the one of the currently visible notification. - Calling
showNotificationreturnsupdate,hide,shake, andisVisiblefunctions for manipulating the notification. - You can mount multiple instances of
NotifierWrapper/NotifierRootand still control them using globalNotifier.*methods. The most recently mounted instance is controlled first; if it unmounts, control reverts to the previously mounted instance. - It's possible to broadcast commands to all mounted instances of Notifier via
Notifier.broadcast.*. This can be used, for example, to hide all notifications or clear the queue and hide them usingNotifier.broadcast.hideNotification(). - Custom handling for safe area insets (based on
react-native-safe-area-context'suseSafeAreaInsetshook) in all built-in components, plus a simple API for using the same insets in custom components. It also handles keyboard offset when a notification is displayed at a bottomposition. All components receive anoffsetsobject and aViewWithOffsetscomponent as props. Related parameters:ignoreSafeAreaInsets,ignoreKeyboard,ignoreKeyboardHeight,additionalKeyboardOffset,additionalOffsets. - Using new
*AnimationConfigparameters, it is now possible to run Spring animations with fully customizable configurations. - Additional TypeScript types have been exported, such as
NotifierComponentProps(for base props in custom components),AnimationFunction,AnimationFunctionParams,Position,Offsets,ViewWithOffsetsComponent,Direction,DuplicateBehavior, andSwipeDirection. - New built-in components:
ToastandSimpleToast. - All components receive a
hidefunction and ananimationFunctionParamsobject as props.
- Alert component: Renamed
alertTypeprop totypefor consistency with other components. ThealertTypeprop remains available but will be deprecated, so please migrate totype. - Notification component: Changed default
borderRadiusfrom5to8and "description"fontSizefrom14to15. - Notification component: Introduced a
typeprop. When set to anything other than'classic', an icon and left border will be displayed. useRNScreensOverlayandrnScreensOverlayViewStyleaccepted not only as props, but also as parameters of theshowNotificationmethod.
- When you mount
NotifierWrapper/NotifierRootwithomitGlobalMethodsHookup={true}and then switch it tofalse, global methods now hook up correctly. - Fixed a jump in the appearing animation when very large notifications appear.
- When
useRNScreensOverlayistrue,SafeAreaViewmight not work correctly. UseViewWithOffsetscomponent that is coming though props into all Custom Components.