mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-26 11:58:53 +00:00
⚡️(frontend) memoize the EffectsButton
Memoize the EffectsButton so it does not re-render on unrelated parent updates when its props have not changed.
This commit is contained in:
+5
-2
@@ -1,9 +1,10 @@
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
|
||||
import { Button } from '@/primitives'
|
||||
import { RiImageCircleAiFill } from '@remixicon/react'
|
||||
|
||||
export const EffectsButton = () => {
|
||||
export const EffectsButton = React.memo(() => {
|
||||
const { t } = useTranslation('rooms', { keyPrefix: 'participantTileFocus' })
|
||||
const { isEffectsOpen, toggleEffects } = useSidePanel()
|
||||
return (
|
||||
@@ -17,4 +18,6 @@ export const EffectsButton = () => {
|
||||
<RiImageCircleAiFill />
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
EffectsButton.displayName = 'EffectsButton'
|
||||
|
||||
Reference in New Issue
Block a user