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:
@@ -77,7 +77,7 @@ export const App: FC<Props> = ({ vm }) => {
|
||||
{loaded ? (
|
||||
<Suspense fallback={null}>
|
||||
<ClientProvider>
|
||||
<MediaDevicesContext.Provider value={vm.mediaDevices}>
|
||||
<MediaDevicesContext value={vm.mediaDevices}>
|
||||
<ProcessorProvider>
|
||||
<Sentry.ErrorBoundary
|
||||
fallback={(error) => (
|
||||
@@ -96,7 +96,7 @@ export const App: FC<Props> = ({ vm }) => {
|
||||
</Routes>
|
||||
</Sentry.ErrorBoundary>
|
||||
</ProcessorProvider>
|
||||
</MediaDevicesContext.Provider>
|
||||
</MediaDevicesContext>
|
||||
</ClientProvider>
|
||||
</Suspense>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user