jsx: viewFragment support null or undefined

This commit is contained in:
pengfei.zhou
2022-07-20 20:58:43 +08:00
committed by osborn
parent 654b63f3c6
commit 7684eaa896
9 changed files with 11 additions and 11 deletions

View File

@@ -157,7 +157,7 @@ export declare abstract class Superview extends View {
toModel(): NativeViewModel;
}
export declare type ViewArray = View[];
export declare type ViewFragment = View | ViewArray;
export declare type ViewFragment = View | ViewArray | undefined | null;
export declare abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
readonly children: View[];
allSubviews(): View[];

View File

@@ -458,7 +458,7 @@ export class Group extends Superview {
else if (e instanceof View) {
this.addChild(e);
}
else {
else if (!!e) {
loge(`Not allowed to add ${typeof e}`);
}
}