react-native-mentions-input
    Preparing search index...

    Type Alias UseMentionsInputReturn<T>

    Return type for the useMentionsInput hook.

    type UseMentionsInputReturn<T = unknown> = {
        clearQuery: () => void;
        currentWord: WordWithPosition | null;
        handleTextChange: (
            newText: string,
        ) => { mentions: Mention<T>[]; query?: string; text: string };
        query: string | null;
        selection: Selection;
        setSelection: (selection: Selection) => void;
    }

    Type Parameters

    • T = unknown

      Optional custom data type for mention metadata

    Index

    Properties

    clearQuery: () => void

    Clear the current query

    currentWord: WordWithPosition | null

    Current word at cursor position

    handleTextChange: (
        newText: string,
    ) => { mentions: Mention<T>[]; query?: string; text: string }

    Handle text changes, returns new state

    query: string | null

    Current search query (null if not in mention mode)

    selection: Selection

    Current text selection

    setSelection: (selection: Selection) => void

    Update the text selection