react 18.0.0-alpha-386e8f2ea-20210624 → 18.0.0-alpha-6bf111772-20210701
Sign up to get free protection for your applications and to get access to all the features.
package/cjs/react.development.js
CHANGED
@@ -15,7 +15,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
15
15
|
|
16
16
|
var _assign = require('object-assign');
|
17
17
|
|
18
|
-
var ReactVersion = '18.0.0-
|
18
|
+
var ReactVersion = '18.0.0-6bf111772-20210701';
|
19
19
|
|
20
20
|
// ATTENTION
|
21
21
|
// When adding new symbols to this file,
|
@@ -2433,21 +2433,22 @@ function act(callback) {
|
|
2433
2433
|
}
|
2434
2434
|
|
2435
2435
|
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
2436
|
-
// The callback is an async function (i.e. returned a promise). Wait
|
2436
|
+
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
2437
2437
|
// for it to resolve before exiting the current scope.
|
2438
|
+
|
2438
2439
|
var wasAwaited = false;
|
2439
2440
|
var thenable = {
|
2440
2441
|
then: function (resolve, reject) {
|
2441
2442
|
wasAwaited = true;
|
2442
|
-
|
2443
|
+
thenableResult.then(function (returnValue) {
|
2443
2444
|
popActScope(prevActScopeDepth);
|
2444
2445
|
|
2445
2446
|
if (actScopeDepth === 0) {
|
2446
2447
|
// We've exited the outermost act scope. Recursively flush the
|
2447
2448
|
// queue until there's no remaining work.
|
2448
|
-
recursivelyFlushAsyncActWork(resolve, reject);
|
2449
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
2449
2450
|
} else {
|
2450
|
-
resolve();
|
2451
|
+
resolve(returnValue);
|
2451
2452
|
}
|
2452
2453
|
}, function (error) {
|
2453
2454
|
// The callback threw an error.
|
@@ -2472,8 +2473,9 @@ function act(callback) {
|
|
2472
2473
|
|
2473
2474
|
return thenable;
|
2474
2475
|
} else {
|
2475
|
-
// The callback is not an async function. Exit the current scope
|
2476
|
+
var returnValue = result; // The callback is not an async function. Exit the current scope
|
2476
2477
|
// immediately, without awaiting.
|
2478
|
+
|
2477
2479
|
popActScope(prevActScopeDepth);
|
2478
2480
|
|
2479
2481
|
if (actScopeDepth === 0) {
|
@@ -2487,7 +2489,7 @@ function act(callback) {
|
|
2487
2489
|
// case additional work was scheduled by a microtask.
|
2488
2490
|
|
2489
2491
|
|
2490
|
-
|
2492
|
+
var _thenable = {
|
2491
2493
|
then: function (resolve, reject) {
|
2492
2494
|
// Confirm we haven't re-entered another `act` scope, in case
|
2493
2495
|
// the user does something weird like await the thenable
|
@@ -2495,18 +2497,22 @@ function act(callback) {
|
|
2495
2497
|
if (ReactCurrentActQueue.current === null) {
|
2496
2498
|
// Recursively flush the queue until there's no remaining work.
|
2497
2499
|
ReactCurrentActQueue.current = [];
|
2498
|
-
recursivelyFlushAsyncActWork(resolve, reject);
|
2500
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
2501
|
+
} else {
|
2502
|
+
resolve(returnValue);
|
2499
2503
|
}
|
2500
2504
|
}
|
2501
2505
|
};
|
2506
|
+
return _thenable;
|
2502
2507
|
} else {
|
2503
2508
|
// Since we're inside a nested `act` scope, the returned thenable
|
2504
2509
|
// immediately resolves. The outer scope will flush the queue.
|
2505
|
-
|
2510
|
+
var _thenable2 = {
|
2506
2511
|
then: function (resolve, reject) {
|
2507
|
-
resolve();
|
2512
|
+
resolve(returnValue);
|
2508
2513
|
}
|
2509
2514
|
};
|
2515
|
+
return _thenable2;
|
2510
2516
|
}
|
2511
2517
|
}
|
2512
2518
|
}
|
@@ -2522,7 +2528,7 @@ function popActScope(prevActScopeDepth) {
|
|
2522
2528
|
}
|
2523
2529
|
}
|
2524
2530
|
|
2525
|
-
function recursivelyFlushAsyncActWork(resolve, reject) {
|
2531
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
2526
2532
|
{
|
2527
2533
|
var queue = ReactCurrentActQueue.current;
|
2528
2534
|
|
@@ -2533,17 +2539,17 @@ function recursivelyFlushAsyncActWork(resolve, reject) {
|
|
2533
2539
|
if (queue.length === 0) {
|
2534
2540
|
// No additional work was scheduled. Finish.
|
2535
2541
|
ReactCurrentActQueue.current = null;
|
2536
|
-
resolve();
|
2542
|
+
resolve(returnValue);
|
2537
2543
|
} else {
|
2538
2544
|
// Keep flushing work until there's none left.
|
2539
|
-
recursivelyFlushAsyncActWork(resolve, reject);
|
2545
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
2540
2546
|
}
|
2541
2547
|
});
|
2542
2548
|
} catch (error) {
|
2543
2549
|
reject(error);
|
2544
2550
|
}
|
2545
2551
|
} else {
|
2546
|
-
resolve();
|
2552
|
+
resolve(returnValue);
|
2547
2553
|
}
|
2548
2554
|
}
|
2549
2555
|
}
|
@@ -21,4 +21,4 @@ exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a
|
|
21
21
|
key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a){a={$$typeof:r,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=K;exports.createFactory=function(a){var b=K.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:t,render:a}};exports.isValidElement=M;
|
22
22
|
exports.lazy=function(a){return{$$typeof:v,_payload:{_status:-1,_result:a},_init:R}};exports.memo=function(a,b){return{$$typeof:u,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=T.transition;T.transition=1;try{a()}finally{T.transition=b}};exports.unstable_act=function(){throw Error(z(406));};exports.unstable_createMutableSource=function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};
|
23
23
|
exports.unstable_useMutableSource=function(a,b,c){return S.current.useMutableSource(a,b,c)};exports.unstable_useOpaqueIdentifier=function(){return S.current.useOpaqueIdentifier()};exports.useCallback=function(a,b){return S.current.useCallback(a,b)};exports.useContext=function(a){return S.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return S.current.useDeferredValue(a)};exports.useEffect=function(a,b){return S.current.useEffect(a,b)};
|
24
|
-
exports.useImperativeHandle=function(a,b,c){return S.current.useImperativeHandle(a,b,c)};exports.useLayoutEffect=function(a,b){return S.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S.current.useMemo(a,b)};exports.useReducer=function(a,b,c){return S.current.useReducer(a,b,c)};exports.useRef=function(a){return S.current.useRef(a)};exports.useState=function(a){return S.current.useState(a)};exports.useTransition=function(){return S.current.useTransition()};exports.version="18.0.0-
|
24
|
+
exports.useImperativeHandle=function(a,b,c){return S.current.useImperativeHandle(a,b,c)};exports.useLayoutEffect=function(a,b){return S.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S.current.useMemo(a,b)};exports.useReducer=function(a,b,c){return S.current.useReducer(a,b,c)};exports.useRef=function(a){return S.current.useRef(a)};exports.useState=function(a){return S.current.useState(a)};exports.useTransition=function(){return S.current.useTransition()};exports.version="18.0.0-6bf111772-20210701";
|
package/package.json
CHANGED
package/umd/react.development.js
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
(global = global || self, factory(global.React = {}));
|
13
13
|
}(this, (function (exports) { 'use strict';
|
14
14
|
|
15
|
-
var ReactVersion = '18.0.0-
|
15
|
+
var ReactVersion = '18.0.0-6bf111772-20210701';
|
16
16
|
|
17
17
|
// ATTENTION
|
18
18
|
// When adding new symbols to this file,
|
@@ -3074,21 +3074,22 @@
|
|
3074
3074
|
}
|
3075
3075
|
|
3076
3076
|
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
3077
|
-
// The callback is an async function (i.e. returned a promise). Wait
|
3077
|
+
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
3078
3078
|
// for it to resolve before exiting the current scope.
|
3079
|
+
|
3079
3080
|
var wasAwaited = false;
|
3080
3081
|
var thenable = {
|
3081
3082
|
then: function (resolve, reject) {
|
3082
3083
|
wasAwaited = true;
|
3083
|
-
|
3084
|
+
thenableResult.then(function (returnValue) {
|
3084
3085
|
popActScope(prevActScopeDepth);
|
3085
3086
|
|
3086
3087
|
if (actScopeDepth === 0) {
|
3087
3088
|
// We've exited the outermost act scope. Recursively flush the
|
3088
3089
|
// queue until there's no remaining work.
|
3089
|
-
recursivelyFlushAsyncActWork(resolve, reject);
|
3090
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
3090
3091
|
} else {
|
3091
|
-
resolve();
|
3092
|
+
resolve(returnValue);
|
3092
3093
|
}
|
3093
3094
|
}, function (error) {
|
3094
3095
|
// The callback threw an error.
|
@@ -3113,8 +3114,9 @@
|
|
3113
3114
|
|
3114
3115
|
return thenable;
|
3115
3116
|
} else {
|
3116
|
-
// The callback is not an async function. Exit the current scope
|
3117
|
+
var returnValue = result; // The callback is not an async function. Exit the current scope
|
3117
3118
|
// immediately, without awaiting.
|
3119
|
+
|
3118
3120
|
popActScope(prevActScopeDepth);
|
3119
3121
|
|
3120
3122
|
if (actScopeDepth === 0) {
|
@@ -3128,7 +3130,7 @@
|
|
3128
3130
|
// case additional work was scheduled by a microtask.
|
3129
3131
|
|
3130
3132
|
|
3131
|
-
|
3133
|
+
var _thenable = {
|
3132
3134
|
then: function (resolve, reject) {
|
3133
3135
|
// Confirm we haven't re-entered another `act` scope, in case
|
3134
3136
|
// the user does something weird like await the thenable
|
@@ -3136,18 +3138,22 @@
|
|
3136
3138
|
if (ReactCurrentActQueue.current === null) {
|
3137
3139
|
// Recursively flush the queue until there's no remaining work.
|
3138
3140
|
ReactCurrentActQueue.current = [];
|
3139
|
-
recursivelyFlushAsyncActWork(resolve, reject);
|
3141
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
3142
|
+
} else {
|
3143
|
+
resolve(returnValue);
|
3140
3144
|
}
|
3141
3145
|
}
|
3142
3146
|
};
|
3147
|
+
return _thenable;
|
3143
3148
|
} else {
|
3144
3149
|
// Since we're inside a nested `act` scope, the returned thenable
|
3145
3150
|
// immediately resolves. The outer scope will flush the queue.
|
3146
|
-
|
3151
|
+
var _thenable2 = {
|
3147
3152
|
then: function (resolve, reject) {
|
3148
|
-
resolve();
|
3153
|
+
resolve(returnValue);
|
3149
3154
|
}
|
3150
3155
|
};
|
3156
|
+
return _thenable2;
|
3151
3157
|
}
|
3152
3158
|
}
|
3153
3159
|
}
|
@@ -3163,7 +3169,7 @@
|
|
3163
3169
|
}
|
3164
3170
|
}
|
3165
3171
|
|
3166
|
-
function recursivelyFlushAsyncActWork(resolve, reject) {
|
3172
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
3167
3173
|
{
|
3168
3174
|
var queue = ReactCurrentActQueue.current;
|
3169
3175
|
|
@@ -3174,17 +3180,17 @@
|
|
3174
3180
|
if (queue.length === 0) {
|
3175
3181
|
// No additional work was scheduled. Finish.
|
3176
3182
|
ReactCurrentActQueue.current = null;
|
3177
|
-
resolve();
|
3183
|
+
resolve(returnValue);
|
3178
3184
|
} else {
|
3179
3185
|
// Keep flushing work until there's none left.
|
3180
|
-
recursivelyFlushAsyncActWork(resolve, reject);
|
3186
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
3181
3187
|
}
|
3182
3188
|
});
|
3183
3189
|
} catch (error) {
|
3184
3190
|
reject(error);
|
3185
3191
|
}
|
3186
3192
|
} else {
|
3187
|
-
resolve();
|
3193
|
+
resolve(returnValue);
|
3188
3194
|
}
|
3189
3195
|
}
|
3190
3196
|
}
|
@@ -27,5 +27,5 @@ a.type.defaultProps;for(h in b)ca.call(b,h)&&!da.hasOwnProperty(h)&&(d[h]=void 0
|
|
27
27
|
function(a){var b=ba.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:oa,render:a}};c.isValidElement=N;c.lazy=function(a){return{$$typeof:qa,_payload:{_status:-1,_result:a},_init:wa}};c.memo=function(a,b){return{$$typeof:pa,type:a,compare:void 0===b?null:b}};c.startTransition=function(a){var b=K.transition;K.transition=1;try{a()}finally{K.transition=b}};c.unstable_act=function(a){throw Error(z(406));};c.unstable_createMutableSource=
|
28
28
|
function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};c.unstable_useMutableSource=function(a,b,c){return m.current.useMutableSource(a,b,c)};c.unstable_useOpaqueIdentifier=function(){return m.current.useOpaqueIdentifier()};c.useCallback=function(a,b){return m.current.useCallback(a,b)};c.useContext=function(a){return m.current.useContext(a)};c.useDebugValue=function(a,b){};c.useDeferredValue=function(a){return m.current.useDeferredValue(a)};
|
29
29
|
c.useEffect=function(a,b){return m.current.useEffect(a,b)};c.useImperativeHandle=function(a,b,c){return m.current.useImperativeHandle(a,b,c)};c.useLayoutEffect=function(a,b){return m.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return m.current.useMemo(a,b)};c.useReducer=function(a,b,c){return m.current.useReducer(a,b,c)};c.useRef=function(a){return m.current.useRef(a)};c.useState=function(a){return m.current.useState(a)};c.useTransition=function(){return m.current.useTransition()};c.version=
|
30
|
-
"18.0.0-
|
30
|
+
"18.0.0-6bf111772-20210701"});
|
31
31
|
})();
|
@@ -27,5 +27,5 @@ a.type.defaultProps;for(h in b)ca.call(b,h)&&!da.hasOwnProperty(h)&&(d[h]=void 0
|
|
27
27
|
function(a){var b=ba.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:oa,render:a}};c.isValidElement=N;c.lazy=function(a){return{$$typeof:qa,_payload:{_status:-1,_result:a},_init:wa}};c.memo=function(a,b){return{$$typeof:pa,type:a,compare:void 0===b?null:b}};c.startTransition=function(a){var b=K.transition;K.transition=1;try{a()}finally{K.transition=b}};c.unstable_act=function(a){throw Error(z(406));};c.unstable_createMutableSource=
|
28
28
|
function(a,b){return{_getVersion:b,_source:a,_workInProgressVersionPrimary:null,_workInProgressVersionSecondary:null}};c.unstable_useMutableSource=function(a,b,c){return m.current.useMutableSource(a,b,c)};c.unstable_useOpaqueIdentifier=function(){return m.current.useOpaqueIdentifier()};c.useCallback=function(a,b){return m.current.useCallback(a,b)};c.useContext=function(a){return m.current.useContext(a)};c.useDebugValue=function(a,b){};c.useDeferredValue=function(a){return m.current.useDeferredValue(a)};
|
29
29
|
c.useEffect=function(a,b){return m.current.useEffect(a,b)};c.useImperativeHandle=function(a,b,c){return m.current.useImperativeHandle(a,b,c)};c.useLayoutEffect=function(a,b){return m.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return m.current.useMemo(a,b)};c.useReducer=function(a,b,c){return m.current.useReducer(a,b,c)};c.useRef=function(a){return m.current.useRef(a)};c.useState=function(a){return m.current.useState(a)};c.useTransition=function(){return m.current.useTransition()};c.version=
|
30
|
-
"18.0.0-
|
30
|
+
"18.0.0-6bf111772-20210701"});
|
31
31
|
})();
|