KeyboardContext
KeyboardContext
is provided by Channel
component. If you are not familiar with React Context API, please read about it on React docs.
#
Basic UsageKeyboardContext
can be consumed by any of the child component of Channel
component as following:
import { useContext } from 'react';
import { KeyboardContext } from 'stream-chat-react-native';
const { dismissKeyboard } = useContext(KeyboardContext);
Alternatively, you can also use useKeyboardContext
hook provided by library to consume KeyboardContext.
import { useKeyboardContext } from 'stream-chat-react-native';
const { dismissKeyboard } = useKeyboardContext();
#
ValuedismissKeyboard
#
Function to dismiss the keyboard.
Type |
---|
function |