Modernize how we use React contexts (#3359)
* Replace useContext with use The docs recommend the use hook because it is simpler and allows itself to be called conditionally. * Simplify our context providers React 19 lets you omit the '.Provider' bit.
This commit is contained in:
@@ -172,7 +172,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
||||
if (livekitRoom === undefined || vm === null) return null;
|
||||
|
||||
return (
|
||||
<RoomContext.Provider value={livekitRoom}>
|
||||
<RoomContext value={livekitRoom}>
|
||||
<ReactionsSenderProvider vm={vm} rtcSession={props.rtcSession}>
|
||||
<InCallView
|
||||
{...props}
|
||||
@@ -181,7 +181,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
||||
connState={connState}
|
||||
/>
|
||||
</ReactionsSenderProvider>
|
||||
</RoomContext.Provider>
|
||||
</RoomContext>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user