UNPKG

stream-chat-react-native-core

Version:

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

17 lines (11 loc) 458 B
import { TextComposerState } from 'stream-chat'; import { useMessageComposer } from './useMessageComposer'; import { useStateStore } from '../../../hooks/useStateStore'; const activeCommandSelector = (state: TextComposerState) => ({ command: state.command, }); export const useActiveCommand = () => { const { textComposer } = useMessageComposer(); const state = useStateStore(textComposer.state, activeCommandSelector); return state.command; };