diff --git a/src/data/types.ts b/src/data/types.ts index 06a60bfb38..421e038cff 100644 --- a/src/data/types.ts +++ b/src/data/types.ts @@ -40,7 +40,7 @@ export interface ImportedDataState { elements?: | readonly ( | (ExcalidrawElement & { - children?: [ + label?: [ { text: string } & MarkOptional< ElementConstructorOpts, "x" | "y" @@ -49,7 +49,7 @@ export interface ImportedDataState { }) | { type: Exclude; - children?: [ + label?: [ { text: string } & MarkOptional< ElementConstructorOpts, "x" | "y" diff --git a/src/element/newElement.ts b/src/element/newElement.ts index 439488f7a5..350268c9dd 100644 --- a/src/element/newElement.ts +++ b/src/element/newElement.ts @@ -659,7 +659,7 @@ export const convertToExcalidrawElements = ( if (!element) { return; } - const textElement = element.children?.find((child) => child.text !== null); + const textElement = element.label?.find((child) => child.text !== null); if ( isValidTextContainer(element) && textElement &&