UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

12 lines (11 loc) 349 B
import { useMemo } from 'react'; export const useCreateTypingContext = (value) => { const { typing } = value; const typingValue = Object.keys(typing || {}).join(); const typingContext = useMemo(() => ({ typing, }), // eslint-disable-next-line react-hooks/exhaustive-deps [typingValue]); return typingContext; };