diff --git a/src/components/Notifications/Notifications.tsx b/src/components/Notifications/Notifications.tsx index 198b18fb..6a74c5d1 100644 --- a/src/components/Notifications/Notifications.tsx +++ b/src/components/Notifications/Notifications.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useMemo } from 'react' import NotificationsFeed from './NotificationsFeed' import { ActiveTab, DCLNotification, NotificationLocale } from './types' @@ -34,9 +34,9 @@ export default function Notifications({ onChangeTab, onBegin }: NotificationsProps) { - const newNotificationsCount = items.filter( - (notification) => !notification.read - ).length + const newNotificationsCount = useMemo(() => { + return items.filter((notification) => !notification.read).length + }, [items]) return (