@unsetsoft/ryunixjs 0.2.26-nightly.7 → 0.2.26-nightly.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.
- package/lib/dom.js +7 -8
- package/package.json +1 -1
package/lib/dom.js
CHANGED
|
@@ -424,8 +424,6 @@ function reconcileChildren(wipFiber, elements) {
|
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
|
|
427
|
-
const EMPTY_CONTEXT = Symbol();
|
|
428
|
-
|
|
429
427
|
/**
|
|
430
428
|
* The function createContext creates a context object with a default value and methods to set and get
|
|
431
429
|
* the context value.
|
|
@@ -434,19 +432,16 @@ const EMPTY_CONTEXT = Symbol();
|
|
|
434
432
|
* @returns a context object.
|
|
435
433
|
*/
|
|
436
434
|
function createContext(defaultValue) {
|
|
437
|
-
let contextValue = defaultValue ||
|
|
435
|
+
let contextValue = defaultValue || null;
|
|
438
436
|
|
|
439
437
|
const context = {
|
|
440
|
-
tag: "
|
|
438
|
+
tag: "RYUNIX_CREATE_CONTEXT",
|
|
441
439
|
Value: contextValue,
|
|
442
440
|
Provider: null,
|
|
443
|
-
Consumer: null,
|
|
444
441
|
};
|
|
445
442
|
|
|
446
443
|
context.Provider = (value) => (context.Value = value);
|
|
447
444
|
|
|
448
|
-
context.Consumer = context.Value;
|
|
449
|
-
|
|
450
445
|
return context;
|
|
451
446
|
}
|
|
452
447
|
|
|
@@ -458,8 +453,12 @@ function useContext(ref) {
|
|
|
458
453
|
wipFiber.alternate.hooks &&
|
|
459
454
|
wipFiber.alternate.hooks[hookIndex];
|
|
460
455
|
|
|
456
|
+
const Context = oldHook ? oldHook : ref;
|
|
457
|
+
|
|
461
458
|
const hook = {
|
|
462
|
-
|
|
459
|
+
tag: "RYUNIX_USE_CONTEXT",
|
|
460
|
+
...Context.Value,
|
|
461
|
+
__context: Context,
|
|
463
462
|
};
|
|
464
463
|
|
|
465
464
|
wipFiber.hooks.push(hook);
|