remove `useMemo` from `hasReactions` (#338)
This commit is contained in:
parent
8bebe944e7
commit
591a9c61bd
|
@ -1,4 +1,4 @@
|
||||||
import React, { useMemo, useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
emojis,
|
emojis,
|
||||||
|
@ -23,9 +23,9 @@ export const MessageReactions = (props: Props) => {
|
||||||
|
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
|
|
||||||
const hasReaction = useMemo(() => {
|
const hasReaction = Object.values<Set<string>>(reactions).some(
|
||||||
return Object.values(reactions).some(value => value.size > 0)
|
value => value.size > 0
|
||||||
}, [reactions])
|
)
|
||||||
|
|
||||||
if (hasReaction === false) {
|
if (hasReaction === false) {
|
||||||
return null
|
return null
|
||||||
|
|
Loading…
Reference in New Issue