MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / _removeView

Function _removeView

packages/core/ui/core/view-base/index.ts:1056–1072  ·  view source on GitHub ↗

* Core logic for removing a child view from this instance. Used by the framework to handle lifecycle events more centralized. Do not use outside the UI Stack implementation.

(view: ViewBase)

Source from the content-addressed store, hash-verified

1054 * Core logic for removing a child view from this instance. Used by the framework to handle lifecycle events more centralized. Do not use outside the UI Stack implementation.
1055 */
1056 public _removeView(view: ViewBase) {
1057 if (Trace.isEnabled()) {
1058 Trace.write(`${this}._removeView(${view})`, Trace.categories.ViewHierarchy);
1059 }
1060
1061 if (view.parent !== this) {
1062 throw new Error('View not added to this instance. View: ' + view + ' CurrentParent: ' + view.parent + ' ExpectedParent: ' + this);
1063 }
1064
1065 if (this.domNode) {
1066 this.domNode.onChildRemoved(view);
1067 }
1068
1069 this._removeViewCore(view);
1070 view.parent = undefined;
1071 view._parentChanged(this);
1072 }
1073
1074 /**
1075 * Method is intended to be overridden by inheritors and used as "protected"

Callers

nothing calls this directly

Calls 4

isEnabledMethod · 0.80
onChildRemovedMethod · 0.80
writeMethod · 0.65
_parentChangedMethod · 0.45

Tested by

no test coverage detected