useFollowManager is a convenience hook for building follow/unfollow buttons on a user profile. It automatically loads the current follow status on mount and exposes a toggleFollow function that handles both following and unfollowing.
Usage Example
Parameters
The ID of the user to follow or unfollow. The hook will not run if this equals the current user’s ID.
Returns
Whether the current user is following the target user.
null while the initial status check is in progress.true while the initial follow status is being fetched.Follows the user if not currently following, or unfollows if currently following. No-ops if loading or if
userId equals the current user’s ID.The current user must be signed in for this hook to function. The hook performs no action if the
userId matches the authenticated user’s own ID.
