Overview
useFetchSpaceChildren returns a callable function that fetches the immediate child spaces of a given space. Results are paginated.
Usage Example
import { useFetchSpaceChildren } from "@replyke/react-js";
function ChildSpaceList({ spaceId }: { spaceId: string }) {
const fetchChildren = useFetchSpaceChildren();
const loadChildren = async () => {
const result = await fetchChildren({ spaceId, page: 1, limit: 20 });
// result.data: Space[]
};
}
Parameters
UUID of the parent space.
Page number. Defaults to 1.
Number of results per page.
Returns
Array of Space objects representing the child spaces.
Standard pagination metadata.
The useSpace hook also includes a childSpaces field with up to 10 previews of children, useful for navigation breadcrumbs without a separate fetch.