Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created December 3, 2022 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sendbird-community/ffbfd734172f6c2d985c002e545ca805 to your computer and use it in GitHub Desktop.
Save sendbird-community/ffbfd734172f6c2d985c002e545ca805 to your computer and use it in GitHub Desktop.
How to use the OpenChannel module
import OpenChannel from '@sendbird/uikit-react/OpenChannel';
import { OpenChannelProvider, useOpenChannelContext } from '@sendbird/uikit-react/OpenChannel/context';
const MyComponent = () => {
const openChannelState = useOpenChannelContext();
return (
...render custom component
);
};
<OpenChannelProvider>
<MyComponent />
<OpenChannelProvider/>
const UserProfile = () => {
const openChannelState = useOpenChannelContext();
return (
...render custom component
);
};
<OpenChannel
renderUserProfile={UserProfile}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment