remove `useMemo` from `hasReactions` (#338)

This commit is contained in:
Felicio Mununga 2023-02-07 12:10:28 +01:00 committed by GitHub
parent 5b48b614e8
commit 691f90f81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import React, { useMemo, useState } from 'react'
import React, { useState } from 'react'
import {
emojis,
@ -23,9 +23,9 @@ export const MessageReactions = (props: Props) => {
const [open, setOpen] = useState(false)
const hasReaction = useMemo(() => {
return Object.values(reactions).some(value => value.size > 0)
}, [reactions])
const hasReaction = Object.values<Set<string>>(reactions).some(
value => value.size > 0
)
if (hasReaction === false) {
return null