useBlockManager is a convenience hook for building block/unblock buttons on a user profile. It automatically loads the current block status on mount and exposes a toggleBlock function that handles both blocking and unblocking.
Blocking is a trust & safety primitive shipped as part of the moderation bundle — the same package that provides reporting and suspensions. See Moderation — Blocking for the full enforcement behavior.
Requires the
moderation bundle. Blocking is available in any project that has the moderation bundle installed. See Bundles to add it.Usage Example
Parameters
The ID of the user to block or unblock. The hook will not run if this equals the current user’s ID.
Returns
Whether the current user blocks the target user.
null while the initial status check is in progress.Blocks the user if the current user does not block them, or unblocks them if they do. 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.
