Skip to content

Commit 05a2e53

Browse files
committed
use BoxChildrenStruct
1 parent 24e3f53 commit 05a2e53

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/snaps-sdk/src/jsx/validation.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,7 @@ export const FieldStruct: Describe<FieldElement> = element('Field', {
507507
children: FieldChildStruct,
508508
});
509509

510-
/**
511-
* A subset of JSX elements that are allowed as children of the Form component.
512-
*/
513-
export const FormChildStruct = children(
510+
export const BoxChildrenStruct = children(
514511
// eslint-disable-next-line @typescript-eslint/no-use-before-define
515512
[lazy(() => BoxChildStruct)],
516513
) as unknown as Struct<SnapsChildren<GenericSnapElement>, null>;
@@ -519,7 +516,8 @@ export const FormChildStruct = children(
519516
* A struct for the {@link FormElement} type.
520517
*/
521518
export const FormStruct: Describe<FormElement> = element('Form', {
522-
children: FormChildStruct,
519+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
520+
children: BoxChildrenStruct,
523521
name: string(),
524522
});
525523

@@ -561,11 +559,6 @@ export const AvatarStruct = element('Avatar', {
561559
size: optional(nullUnion([literal('sm'), literal('md'), literal('lg')])),
562560
}) as unknown as Struct<AvatarElement, null>;
563561

564-
export const BoxChildrenStruct = children(
565-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
566-
[lazy(() => BoxChildStruct)],
567-
) as unknown as Struct<SnapsChildren<GenericSnapElement>, null>;
568-
569562
/**
570563
* A struct for the {@link BoxElement} type.
571564
*/

0 commit comments

Comments
 (0)