Overview
Returns a function that removes a connection with another user by theiruserId, without needing the connection record ID. The server determines the correct action (withdraw, disconnect, or decline) based on the current state. The current user must be authenticated.
This hook is used internally by
useConnectionManager’s removeConnectionSmart function.Usage Example
Parameters
The hook returns a function. That function accepts:string
required
The ID of the user to disconnect from. Cannot be the current user’s own ID.
Returns
string | undefined
The connection record ID, if applicable.
"withdraw" | "disconnect" | "decline" | undefined
The action performed by the server.
string | undefined
A confirmation message.
Related
- useRemoveConnection — remove by connection ID
- useConnectionManager — wraps this as
removeConnectionSmart

