Skip to main content

Overview

useUpdateSpace returns a callable function for updating a space. Only space admins can update a space. Supports updating avatar and banner images.
When using SpaceProvider, prefer calling updateSpace from useSpace — it handles state updates automatically.

Usage Example

import { useUpdateSpace } from "@replyke/react-js";

function SpaceSettings({ spaceId }: { spaceId: string }) {
  const updateSpace = useUpdateSpace();

  const handleSave = async (name: string, description: string) => {
    const updated = await updateSpace({
      spaceId,
      update: { name, description },
    });
    console.log("Updated:", updated.name);
  };
}

Parameters

spaceId
string
required
UUID of the space to update.
update
object
required
Fields to update. All fields are optional.

Returns

Returns the updated SpaceDetailed object.