Skip to main content

useFetchUserSuggestions

Overview

The useFetchUserSuggestions hook is used to retrieve a list of suggested users based on a search query. This is commonly used in features like @mentions, user search, or friend suggestions.

Usage Example

Parameters & Returns

Parameters

The hook returns a function that accepts the following parameter:
query
string
required
The search query for user suggestions.

Returns

The function resolves with an array of user objects:
User[]
User[]
A list of user objects matching the query.

Implementation Details

  • Uses the public API endpoint (no authentication required)
  • Searches users within the current project context
  • Returns full User objects with all available user information
  • Typically used as a building block for more complex mention functionality