useSpaceList hook provides a Redux-backed, paginated list of spaces with support for filtering, sorting, and search. It lists the space directory, for discovery and browse pages. For the spaces the current user is a member of, see My spaces below. Spaces in a list carry no memberPermissions; to show what the current user may do in one, load it with SpaceProvider or useFetchSpace.
Basic Usage
Filtering and Sorting
parentSpaceId: "none" on every page, including loadMore and a re-sort, until you name a parent or "any".
Sort Options
Pass
sortDir: "asc" or "desc" to reverse any of them, for example fetchSpaces({ filters: { sortBy: "createdAt", sortDir: "asc" } }) for oldest first. Left out, each sort uses the direction above.
Creating and Deleting from a List
useSpaceList also exposes create and delete operations that automatically update the list state:
Multiple Independent Lists
EachuseSpaceList call uses a listId to maintain independent Redux state. You can have multiple lists on the same page without interference:
My Spaces
Across levels (parentSpaceId "none" or "any"), a space list includes a space only if it and every space above it are public. Under one parent (a space id), it includes the sub-spaces the user can see that are public or that they’re an active member of — the same ones the parent’s childSpaces preview shows and its childSpacesCount counts. For a “my spaces” screen, use useFetchMySpaces: it lists the spaces the current user is a member of, whatever their visibility, with their membership on each, and takes its own query, searchFields, sortBy ("joinedAt", the default, "createdAt", "members" or "alphabetical") and sortDir.
It also takes parentSpaceId: "none" for the user’s memberships in top-level spaces only, or a space id for their memberships in that space’s direct sub-spaces. "any", left out or null: memberships at every level (the default, because membership is per space). "none" goes by where the space sits, not by what the user belongs to: a membership in a sub-space whose parent the user isn’t in is not top-level, so "none" leaves it out.
Return Values
The last load failure, or
null. Cleared when the next load starts; loadMore() retries it. A SublayError.Trigger a new fetch with the given filters and configuration, as one object. Resets to page 1.
Fetch the next page of results and append it, or retry the load that failed. Never rejects: a failure lands in
error.Reload page 1 with the list’s stored filters, sort and config. The loaded spaces stay until the new first page replaces them. Never rejects.

