anu-verzum 2.2.6 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,6 +144,9 @@ const updateClassComponent = wipFiber => {
144
144
  wipFiber.stateNode.componentWillUnmount = wipFiber.stateNode.componentWillUnmount.bind(wipFiber.stateNode);
145
145
  }
146
146
  } else if (wipFiber.props === instance.props && !wipFiber.partialState && !wipFiber.partialStateCallback) {
147
+ wipFiber.prevState = {
148
+ ...instance.state
149
+ };
147
150
  cloneChildFibers(wipFiber);
148
151
  return;
149
152
  }
@@ -416,35 +419,32 @@ const commitDeletion = (fiber, domParent) => {
416
419
  }
417
420
  node.stateNode.__fiber = null;
418
421
  });
419
- let node = fiber;
420
- while (node) {
421
- if (node.tag === CLASS_COMPONENT || node.tag === FUNCTION_COMPONENT) {
422
- node = node.child;
423
- continue;
424
- }
425
- if (node.tag === PORTAL) {
426
- if (node.child) {
427
- commitDeletion(node.child, node.stateNode);
428
- }
429
- while (node !== fiber && !node.sibling) {
430
- node = node.parent;
431
- }
432
- if (node === fiber) {
433
- return;
434
- }
435
- node = node.sibling;
436
- continue;
437
- }
438
- if (domParent.contains(node.stateNode)) {
439
- domParent.removeChild(node.stateNode);
422
+ removeFiberDom(fiber, domParent);
423
+ };
424
+ const removeFiberDom = (fiber, domParent) => {
425
+ if (fiber.tag === PORTAL) {
426
+ let child = fiber.child;
427
+ while (child) {
428
+ removeFiberDom(child, fiber.stateNode);
429
+ child = child.sibling;
440
430
  }
441
- while (node !== fiber && !node.sibling) {
442
- node = node.parent;
431
+ return;
432
+ }
433
+ if (fiber.tag === HOST_COMPONENT) {
434
+ let child = fiber.child;
435
+ while (child) {
436
+ removeFiberDom(child, fiber.stateNode);
437
+ child = child.sibling;
443
438
  }
444
- if (node === fiber) {
445
- return;
439
+ if (domParent.contains(fiber.stateNode)) {
440
+ domParent.removeChild(fiber.stateNode);
446
441
  }
447
- node = node.sibling;
442
+ return;
443
+ }
444
+ let child = fiber.child;
445
+ while (child) {
446
+ removeFiberDom(child, domParent);
447
+ child = child.sibling;
448
448
  }
449
449
  };
450
450
  const createRef = () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anu-verzum",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
4
4
  "description": "A \"React-like\" UI library that supports JSX syntax, Redux-like state management, array-rendering, i18n, routing and many more.",
5
5
  "keywords": [
6
6
  "anu-verzum",