we are using react-native-paper and UserContext structure
import React, { useEffect, useReducer, useRef } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { DefaultTheme, Provider, configureFonts } from 'react-native-paper';
import { UserContext } from './src/utils/UserContext';
import { reducer, initialState, actionTypes } from './src/utils/Reducer';
import Splash from './src/pages/Splash';
import Login from './src/pages/Login';
import { ZoomVideoSdkProvider } from '@zoom/react-native-videosdk';
const theme = {
...DefaultTheme
};
const App = () => {
const navigationRef = useRef(null);
const [state, dispatch] = useReducer(reducer, initialState);
return (
<Provider theme={theme}>
<UserContext.Provider value={{ state, dispatch }}>
<NavigationContainer ref={navigationRef}>
<RootStack />
</NavigationContainer>
</UserContext.Provider>
</Provider>
);
};
const Stack = createNativeStackNavigator();
function RootStack() {
return (
<Stack.Navigator
initialRouteName="Splash"
screenOptions={{ headerShown: false }}>
<Stack.Group>
<Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="Login" component={Login} />
…rest of the screens
</Stack.Group>
</Stack.Navigator>
);
}
export default App;
Without ZoomVideoSdkProvider Error: Cannot access the Zoom Video SDK without a ZoomVideoSdkProvider component wrapping your entire application.
If i add ZoomVideoSdkProvider
return (
<Provider theme={theme}>
<UserContext.Provider value={{ state, dispatch }}>
<NavigationContainer ref={navigationRef}>
<ZoomVideoSdkProvider
config={{
appGroupId: 'group.test.sdk',
domain: 'zoom.us',
enableLog: true,
}}>
<RootStack />
</ZoomVideoSdkProvider>
</NavigationContainer>
</UserContext.Provider>
</Provider>
);
};
Error: ZoomVideoSDKError_Wrong_Usage