useEditableRichText

See source code
function useEditableRichText(
  shapeId: TLShapeId,
  type: ExtractShapeByProps<{
    richText: TLRichText;
  }>["type"],
  richText?: TLRichText,
): {
  handleBlur: () => void;
  handleChange: ({ richText }: { richText: TLRichText }) => void;
  handleDoubleClick: (
    e:
      | {
          nativeEvent: Event;
        }
      | Event,
  ) => void;
  handleFocus: () => void;
  handleInputPointerDown: (e: React.PointerEvent) => void;
  handleKeyDown: (e: KeyboardEvent) => void;
  handlePaste: (
    e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>,
  ) => void;
  isEditing: boolean;
  isEmpty: boolean | undefined;
  isReadyForEditing: boolean;
  rInput: import("react").RefObject<HTMLDivElement | null>;
};

Parameters

NameDescription

shapeId

type

ExtractShapeByProps<{
  richText: TLRichText;
}>["type"];

richText

Returns

{
  handleBlur: () => void;
  handleChange: ({ richText }: { richText: TLRichText }) => void;
  handleDoubleClick: (
    e:
      | {
          nativeEvent: Event;
        }
      | Event,
  ) => void;
  handleFocus: () => void;
  handleInputPointerDown: (e: React.PointerEvent) => void;
  handleKeyDown: (e: KeyboardEvent) => void;
  handlePaste: (
    e: ClipboardEvent | React.ClipboardEvent<HTMLTextAreaElement>,
  ) => void;
  isEditing: boolean;
  isEmpty: boolean | undefined;
  isReadyForEditing: boolean;
  rInput: import("react").RefObject<HTMLDivElement | null>;
};
Prev
useEditablePlainText
Next
useExportAs