mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-30 12:09:08 +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:
committed by
aleb_the_flash
parent
73aa162dc8
commit
a663b4dc76
+5
-2
@@ -1,9 +1,10 @@
|
|||||||
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
|
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
|
||||||
import { Button } from '@/primitives'
|
import { Button } from '@/primitives'
|
||||||
import { RiImageCircleAiFill } from '@remixicon/react'
|
import { RiImageCircleAiFill } from '@remixicon/react'
|
||||||
|
|
||||||
export const EffectsButton = () => {
|
export const EffectsButton = React.memo(() => {
|
||||||
const { t } = useTranslation('rooms', { keyPrefix: 'participantTileFocus' })
|
const { t } = useTranslation('rooms', { keyPrefix: 'participantTileFocus' })
|
||||||
const { isEffectsOpen, toggleEffects } = useSidePanel()
|
const { isEffectsOpen, toggleEffects } = useSidePanel()
|
||||||
return (
|
return (
|
||||||
@@ -17,4 +18,6 @@ export const EffectsButton = () => {
|
|||||||
<RiImageCircleAiFill />
|
<RiImageCircleAiFill />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
})
|
||||||
|
|
||||||
|
EffectsButton.displayName = 'EffectsButton'
|
||||||
|
|||||||
Reference in New Issue
Block a user