Skip to content

Instantly share code, notes, and snippets.

@sendbird-community
Created December 3, 2022 20:42
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/314c01c26a9bd0e932ec255578eac7eb to your computer and use it in GitHub Desktop.
Save sendbird-community/314c01c26a9bd0e932ec255578eac7eb to your computer and use it in GitHub Desktop.
How to implement message search
import MessageSearch from '@sendbird/uikit-react/MessageSearch;
import { MessageSearchProvider, useMessageSearchContext } from '@sendbird/uikit-react/MessageSearch/context';
const MyComponent = () => {
const messageSearchState = useMessageSearchContext();
return (
...render custom component
);
};
<MessageSearchProvider>
<MyComponent />
<MessageSearchProvider/>
const EmptyListView = () => {
const messageSearchState = useMessageSearchContext();
return (
...render custom component
);
};
<MessageSearch
renderPlaceholderEmptyList={EmptyListView}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment