@unsetsoft/ryunixjs 0.2.26-nightly.10 → 0.2.26-nightly.12
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.
- package/lib/dom.js +11 -10
- package/package.json +1 -1
package/lib/dom.js
CHANGED
|
@@ -435,7 +435,7 @@ function createContext(defaultValue) {
|
|
|
435
435
|
let contextValue = defaultValue || null;
|
|
436
436
|
|
|
437
437
|
const context = {
|
|
438
|
-
tag: "
|
|
438
|
+
tag: "RYUNIX_CONTEXT",
|
|
439
439
|
Value: contextValue,
|
|
440
440
|
Provider: null,
|
|
441
441
|
};
|
|
@@ -448,21 +448,22 @@ function createContext(defaultValue) {
|
|
|
448
448
|
// Hooks
|
|
449
449
|
|
|
450
450
|
function useContext(ref) {
|
|
451
|
-
const Context = oldHook ? oldHook : ref;
|
|
452
|
-
|
|
453
|
-
const hook = {
|
|
454
|
-
tag: "RYUNIX_USE_CONTEXT",
|
|
455
|
-
__context: Context,
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
wipFiber.hooks.push(hook);
|
|
459
451
|
hookIndex++;
|
|
452
|
+
|
|
460
453
|
const oldHook =
|
|
461
454
|
wipFiber.alternate &&
|
|
462
455
|
wipFiber.alternate.hooks &&
|
|
463
456
|
wipFiber.alternate.hooks[hookIndex];
|
|
464
457
|
|
|
465
|
-
|
|
458
|
+
const hasOld = oldHook ? oldHook : undefined;
|
|
459
|
+
const Context = hasOld ? hasOld : ref;
|
|
460
|
+
const hook = {
|
|
461
|
+
...Context,
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
wipFiber.hooks.push(hook);
|
|
465
|
+
|
|
466
|
+
return hook.Value;
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
/**
|