mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-22 08:07:26 +00:00
♻️(frontend) move InviteDialog state down the React tree
The InviteDialog open state was managed very high in the React tree, which triggered a re-render of the whole conference tree whenever the dialog was opened or closed. Push the state down to a narrower component to limit the scope of re-renders. Part of a broader effort to isolate as much as possible what should re-render, so we can then focus on tackling the real performance issues.
This commit is contained in:
committed by
aleb_the_flash
parent
63a7de402b
commit
8cd6496b5b
@@ -170,7 +170,6 @@ export const Conference = ({
|
||||
prepareConnection()
|
||||
}, [room, apiConfig, isConnectionWarmedUp])
|
||||
|
||||
const [showInviteDialog, setShowInviteDialog] = useState(mode === 'create')
|
||||
const [mediaDeviceError, setMediaDeviceError] = useState<{
|
||||
error: MediaDeviceFailure | null
|
||||
kind: MediaDeviceKind | null
|
||||
@@ -303,13 +302,7 @@ export const Conference = ({
|
||||
}}
|
||||
>
|
||||
<VideoConference />
|
||||
{showInviteDialog && !isMobile && (
|
||||
<InviteDialog
|
||||
isOpen={showInviteDialog}
|
||||
onOpenChange={setShowInviteDialog}
|
||||
onClose={() => setShowInviteDialog(false)}
|
||||
/>
|
||||
)}
|
||||
{!isMobile && <InviteDialog mode={mode} />}
|
||||
<MediaDeviceErrorAlert
|
||||
{...mediaDeviceError}
|
||||
onClose={() => setMediaDeviceError({ error: null, kind: null })}
|
||||
|
||||
Reference in New Issue
Block a user