Overview
useSpace returns the current space state and all operations from the nearest SpaceProvider. It is the primary way to interact with a space in your component tree.
This hook must be used inside a
SpaceProvider.Usage Example
Returns
The loaded space.
undefined while loading, null if not found.true while fetching the space.Error message if the fetch failed.
true if the current user has an active membership.true if the current user is a space admin.true if the current user is a space moderator.true if the current user can post entities in this space.true if the current user can perform moderation actions.Raw membership status.
null if not a member.true if the user’s join request is awaiting approval.true if the user is banned from this space.Ancestor spaces from root to direct parent. Empty for root spaces.
Preview of the parent space.
null for root spaces.Previews of direct child spaces (up to 10).
Join the space. Creates a
pending membership when approval is required.Leave the space.
Update space settings (admin only).
Delete the space (admin only).
Directly update the space state for optimistic UI updates.

