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

Method appendChild

src/components/View/RNView.ts:241–251  ·  view source on GitHub ↗
(child: QWidget<any>)

Source from the content-addressed store, hash-verified

239 this.appendChild(child);
240 }
241 appendChild(child: QWidget<any>): void {
242 if (!child || child instanceof QDialog) {
243 return;
244 }
245 if (!this.layout()) {
246 const flexLayout = new FlexLayout();
247 flexLayout.setFlexNode(this.getFlexNode());
248 this.setLayout(flexLayout);
249 }
250 this.layout()!.addWidget(child);
251 }
252 removeChild(child: QWidget<any>) {
253 if (!this.layout()) {
254 console.warn("parent has no layout to remove child from");

Callers 1

appendInitialChildMethod · 0.95

Calls 2

layoutMethod · 0.95
setLayoutMethod · 0.95

Tested by

no test coverage detected