Skip to content

Commit

Permalink
fix: use memo
Browse files Browse the repository at this point in the history
  • Loading branch information
lauti7 committed Dec 5, 2023
1 parent 00ee6e3 commit 4f031b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Notifications/Notifications.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useMemo } from 'react'

import NotificationsFeed from './NotificationsFeed'
import { ActiveTab, DCLNotification, NotificationLocale } from './types'
Expand Down Expand Up @@ -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 (
<div className="dcl notifications">
Expand Down

0 comments on commit 4f031b2

Please sign in to comment.