Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created December 7, 2021 09:14
Show Gist options
  • Save hieptl/5e1963b1b972991426546c5d89e5bfd5 to your computer and use it in GitHub Desktop.
Save hieptl/5e1963b1b972991426546c5d89e5bfd5 to your computer and use it in GitHub Desktop.
conversations.js
import React, { useContext } from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { CometChatUserListWithMessages, CometChatMessages } from '../cometchat-pro-react-native-ui-kit';
import Context from '../context';
const Conversations = () => {
const Stack = createNativeStackNavigator();
const { cometChat } = useContext(Context);
if (!cometChat) {
return;
}
return (
<Stack.Navigator
screenOptions={{ headerShown: false }}
initialRouteName={"UserListWithMessages"}>
<Stack.Screen name="UserListWithMessages" component={CometChatUserListWithMessages} />
<Stack.Screen name="CometChatMessages" component={CometChatMessages} />
</Stack.Navigator>
);
};
export default Conversations;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment