useNotifications
Learn how to use the useNotifications hook to fetch and manage notifications in your React Native application
The useNotifications
hook provides a way to fetch and manage notifications in your React Native application. It includes support for pagination, filtering, and real-time updates.
Hook Parameters
Parameter | Type | Required | Description |
---|---|---|---|
storeId | string | No | Filter notifications by a specific store ID |
query | object | No | Additional query parameters for filtering |
Return Value
Example Usage
Here's how to use the useNotifications
hook to fetch and display notifications:
With Pull to Refresh
You can implement pull-to-refresh using the refetch
function:
With Filters
You can apply filters using the query parameter:
The notifications list is automatically updated in real-time when new notifications arrive or when notifications are marked as read/unread.