Skip to main content

NotificationList

NotificationList, which renders the current list when other users send you friend requests, follow you, invite you to groups, subscribe to topics and post content. And must be nested as children of Chat to maintain proper functionality.

Basic Usage

tip

You can try to get other users to follow you or send you friend requests to get the notification list to show content.

NotificationList UI is determined by two of its props, Notification and EmptyContaniner . The Notification prop dictates the design and click functionality of an individual notification in the list.The EmptyContainer prop allows you to customize the container when NotificationList is empty. If not provided via props, these UI components will render the default style. Each item will trigger setActiveNotification when clicked

const { setActiveNotification } = useChat('NotificationList');

API

NotificationList

The properties of the NotificationList are described as follows:

PropertyDescriptionTypeDefaultrequired
Notificationset your custom Notification in listReact.ComponentType-false
EmptyContaninerdisplays an empty list of componentsReact.ReactNode-false

NotificationPreview

The properties of the NotificationPreview are described as follows:

PropertyDescriptionTypeDefaultrequired
clientClient InstanceClient-true
notificationnotification content in listNotifyResponse-true
userInfoinfo about the user who pushed the notification to meCommonUserInfoType | undefined-false
setActiveNotificationset the current notification as activeReact.Dispatch-true