function useMentionAutocomplete
useMentionAutocomplete(
replace: (
start: number,
end: number,
text: string,
word: boolean
) => void
,
everyone?: boolean
): UseMentionAutocompleteResult

Returns the suggestions' state and the functions that drive them. A pick goes through replace, TextEditor's function that puts the text over [start, end) of the textarea's value, followed by a space when word is set. With everyone, which the chat's composer sets for a role with chat:everyone, @everyone is offered too.

Parameters

replace: (
start: number,
end: number,
text: string,
word: boolean
) => void
optional
everyone: boolean = false

Return Type

Usage

import { useMentionAutocomplete } from "src/hooks/editor/useMentionAutocomplete.ts";