Created
October 7, 2022 13:25
-
-
Save hieptlccc/51faa9db6fa05accfae3f74b06b6d853 to your computer and use it in GitHub Desktop.
Facebook Clone React - index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './styles/index.css'; | |
import App from './App'; | |
import { CometChat } from '@cometchat-pro/chat'; | |
import { cometChat } from './app.config' | |
const appID = cometChat.APP_ID | |
const region = cometChat.REGION | |
const appSetting = new CometChat.AppSettingsBuilder() | |
.subscribePresenceForAllUsers() | |
.setRegion(region) | |
.build() | |
CometChat.init(appID, appSetting) | |
.then(() => { | |
ReactDOM.render( | |
<App />, | |
document.getElementById('root') | |
) | |
console.log('Initialization completed successfully') | |
}) | |
.catch((error) => { | |
console.log('Initialization failed with error:', error) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment