stream-chat-react
Version:
React components to create chat conversations or livestream style chat
13 lines (12 loc) • 527 B
JavaScript
import React, { createContext, useContext } from 'react';
export const MessageInputContext = createContext(undefined);
export const MessageInputContextProvider = ({ children, value, }) => (React.createElement(MessageInputContext.Provider, { value: value }, children));
export const useMessageInputContext = (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
componentName) => {
const contextValue = useContext(MessageInputContext);
if (!contextValue) {
return {};
}
return contextValue;
};