UNPKG

stream-chat-react-native-core

Version:

The official React Native and Expo components for Stream Chat, a service for building chat applications

18 lines (13 loc) 451 B
import { useMemo } from 'react'; import type { TypingContextValue } from '../../../contexts/typingContext/TypingContext'; export const useCreateTypingContext = ({ typing }: TypingContextValue) => { const typingValue = Object.keys(typing).join(); const typingContext: TypingContextValue = useMemo( () => ({ typing, }), // eslint-disable-next-line react-hooks/exhaustive-deps [typingValue], ); return typingContext; };