Skip to content

Commit

Permalink
use memo
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisamir98 committed Dec 5, 2024
1 parent cc8f703 commit bcec62e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import React from 'react';
import React, {useMemo} from 'react';

import cx from 'classnames';

Expand Down Expand Up @@ -82,9 +82,11 @@ export const CallingParticipantList = ({
showContextMenu({event, entries, identifier: 'participant-moderator-menu'});
};

const participantsList = participants
.slice()
.sort((participantA, participantB) => sortUsersByPriority(participantA.user, participantB.user));
const participantsList = useMemo(() => {
return participants
.slice()
.sort((participantA, participantB) => sortUsersByPriority(participantA.user, participantB.user));
}, [participants]);

return (
<div
Expand Down

0 comments on commit bcec62e

Please sign in to comment.