mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
Make hotloading and forceUpdate work (#164)
This commit is contained in:
parent
77da61bb19
commit
b30c828b95
3 changed files with 14 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
Group,
|
||||
Window,
|
||||
Slider,
|
||||
Root,
|
||||
} from './';
|
||||
import { Menu } from '../';
|
||||
import {
|
||||
|
|
@ -71,8 +72,18 @@ class DesktopComponent {
|
|||
}
|
||||
|
||||
removeChild(child) {
|
||||
if (this.exists(child.children)) {
|
||||
// we recursively remove all children
|
||||
child.children.forEach(function(w) {
|
||||
child.removeChild(w);
|
||||
});
|
||||
}
|
||||
// remove it, and destroy it
|
||||
if (this.exists(this.element.setChild)) {
|
||||
if (this instanceof Root) {
|
||||
// root doesn't have any remove method
|
||||
} else if (typeof child === 'string') {
|
||||
// strings don't have remove methods either
|
||||
} else if (this.exists(this.element.setChild)) {
|
||||
// if it can only have one child, we don't need to "de-render" it
|
||||
} else if (this.exists(this.element.deleteAt)) {
|
||||
// if it can have multiple ex. VerticalBox
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ const DesktopRenderer = Reconciler({
|
|||
if (parentInstance.appendChild) {
|
||||
parentInstance.appendChild(child);
|
||||
}
|
||||
if (typeof child.render === 'function') child.render(parentInstance); // we just added a new child, so we want to render it
|
||||
},
|
||||
|
||||
removeChild(parentInstance, child) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function render(element) {
|
|||
|
||||
// Schedules a top level update with current fiber and a priority level (depending upon the context)
|
||||
DesktopRenderer.updateContainer(element, node, null);
|
||||
ROOT_NODE.render();
|
||||
//ROOT_NODE.render();
|
||||
}
|
||||
|
||||
export default render;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue