Hook to create a space.

Imports

import { useCreateSpace } from '@river-build/react-sdk'

Definition

function useCreateSpace(
  config?: ActionConfig<Spaces['createSpace']>,
): {
    data: {
        spaceId: string;
        defaultChannelId: string;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createSpace: (params: Partial<Omit<CreateSpaceParams, "spaceName">> & {
        spaceName: string;
    }, signer: Signer) => Promise<{
        spaceId: string;
        defaultChannelId: string;
    }>;
}

Source: useCreateSpace

Parameters

config

  • Type: ActionConfig<Spaces['createSpace']>
  • Optional

Configuration options for the action.

Return Type

The createSpace action and its loading state.

{
    data: {
        spaceId: string;
        defaultChannelId: string;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createSpace: (params: Partial<Omit<CreateSpaceParams, "spaceName">> & {
        spaceName: string;
    }, signer: Signer) => Promise<{
        spaceId: string;
        defaultChannelId: string;
    }>;
}