Skip to main content

🐣 Basic usage

Create Notifications

import { createNotifications } from 'react-native-notificated'

const { NotificationsProvider, useNotifications, ...events } = createNotifications()

🛠 Add or Wrap your entry component with NotificationsProvider

return (
<>
<App />
<NotificationsProvider />
</>
)

OR

return (
<NotificationsProvider>
<App />
</NotificationsProvider>
)

📢 Display notification

const { notify } = useNotifications()

const notificationMetadata = notify('success', {
params: {
title: 'Hello',
description: 'Wow, that was easy',
},
})

🔨 Modify notification

const { modify } = useNotifications()

modify({
id: notificationMetadata.id,
params: { title: 'New title', description: 'New description' },
})

🗑 Remove notification

const { remove } = useNotifications()

remove(notificationMetadata.id)