MCPcopy Index your code
hub / github.com/nodegui/react-nodegui / appendChild

Method appendChild

src/components/List/RNList.ts:38–52  ·  view source on GitHub ↗
(child: RNListItem)

Source from the content-addressed store, hash-verified

36 this.appendChild(child);
37 }
38 appendChild(child: RNListItem): void {
39 if (!this.layout()) {
40 this.setLayout(new FlexLayout());
41 }
42
43 if (!(child instanceof RNListItem)) {
44 throw new Error("Children of list should be of type ListItem");
45 }
46
47 this.addItem(child);
48 if (child.actualListItemWidget) {
49 child.setSizeHint(child.actualListItemWidget.size());
50 this.setItemWidget(child, child.actualListItemWidget);
51 }
52 }
53 insertBefore(child: RNListItem, beforeChild: RNListItem): void {
54 const row = this.row(beforeChild);
55 this.insertItem(row, child);

Callers 1

appendInitialChildMethod · 0.95

Calls 2

layoutMethod · 0.45
setLayoutMethod · 0.45

Tested by

no test coverage detected