nodegui / react-nodegui

Build performant, native and cross-platform desktop applications with native React + powerful CSS like styling.🚀
https://react.nodegui.org
MIT License
6.18k stars 171 forks source link

RNList and FlexLayout #369

Open liuqi-sun opened 2 years ago

liuqi-sun commented 2 years ago

appendChild(child: RNListItem): void { if (!this.layout) { this.setLayout(new FlexLayout()); }

if (!(child instanceof RNListItem)) {
  throw new Error("Children of list should be of type ListItem");
}

this.addItem(child);
if (child.actualListItemWidget) {
  child.setSizeHint(child.actualListItemWidget.size());
  this.setItemWidget(child, child.actualListItemWidget);
}

}

in this codes, What does new FlexLayout() do?