# tableberg/1.1.5/src/hooks/block-editor-compat/useBlockCardUpdateShim.ts

Tableberg – Simple Gutenberg Table Block, version 1.1.5. 27 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.1.5/code/src/hooks/block-editor-compat/useBlockCardUpdateShim.ts
- Raw: https://pluginprobe.com/plugins/tableberg/1.1.5/raw/src/hooks/block-editor-compat/useBlockCardUpdateShim.ts
- Modified: 2026-09-16T03:30:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/1.1.5/code/src/hooks/block-editor-compat/useBlockCardUpdateShim.ts#L10-L20`.

```typescript
import { useCallback } from "react";

export function useBlockCardUpdateShim() {
    return useCallback(
        (element: HTMLElement, title: string, description: string) => {
            const ownerDoc = element.ownerDocument;
            const parentDoc =
                ownerDoc.defaultView?.parent?.document || ownerDoc;

            const blockCardTitle = parentDoc.querySelector(
                ".block-editor-block-card__title"
            );
            if (blockCardTitle) {
                blockCardTitle.textContent = title;
            }

            const blockCardDescription = parentDoc.querySelector(
                ".block-editor-block-card__description"
            );
            if (blockCardDescription) {
                blockCardDescription.textContent = description;
            }
        },
        []
    );
}

```
