react-dom 16.8.3 → 16.8.4
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/build-info.json +5 -5
- package/cjs/react-dom-server.browser.development.js +2 -2
- package/cjs/react-dom-server.browser.production.min.js +2 -2
- package/cjs/react-dom-server.node.development.js +2 -2
- package/cjs/react-dom-server.node.production.min.js +2 -2
- package/cjs/react-dom-test-utils.development.js +1 -1
- package/cjs/react-dom-test-utils.production.min.js +1 -1
- package/cjs/react-dom-unstable-fire.development.js +224 -66
- package/cjs/react-dom-unstable-fire.production.min.js +2 -2
- package/cjs/react-dom-unstable-fire.profiling.min.js +2 -2
- package/cjs/react-dom-unstable-fizz.browser.development.js +1 -1
- package/cjs/react-dom-unstable-fizz.browser.production.min.js +1 -1
- package/cjs/react-dom-unstable-fizz.node.development.js +1 -1
- package/cjs/react-dom-unstable-fizz.node.production.min.js +1 -1
- package/cjs/react-dom-unstable-native-dependencies.development.js +1 -1
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +1 -1
- package/cjs/react-dom.development.js +224 -66
- package/cjs/react-dom.production.min.js +2 -2
- package/cjs/react-dom.profiling.min.js +2 -2
- package/package.json +2 -2
- package/umd/react-dom-server.browser.development.js +2 -2
- package/umd/react-dom-server.browser.production.min.js +2 -2
- package/umd/react-dom-test-utils.development.js +1 -1
- package/umd/react-dom-test-utils.production.min.js +1 -1
- package/umd/react-dom-unstable-fire.development.js +224 -66
- package/umd/react-dom-unstable-fire.production.min.js +2 -2
- package/umd/react-dom-unstable-fire.profiling.min.js +2 -2
- package/umd/react-dom-unstable-fizz.browser.development.js +1 -1
- package/umd/react-dom-unstable-fizz.browser.production.min.js +1 -1
- package/umd/react-dom-unstable-native-dependencies.development.js +1 -1
- package/umd/react-dom-unstable-native-dependencies.production.min.js +1 -1
- package/umd/react-dom.development.js +224 -66
- package/umd/react-dom.production.min.js +2 -2
- package/umd/react-dom.profiling.min.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.4
|
|
2
2
|
* react-dom.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -10001,6 +10001,7 @@ function FiberNode(tag, pendingProps, key, mode) {
|
|
|
10001
10001
|
this._debugSource = null;
|
|
10002
10002
|
this._debugOwner = null;
|
|
10003
10003
|
this._debugIsCurrentlyTiming = false;
|
|
10004
|
+
this._debugHookTypes = null;
|
|
10004
10005
|
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
|
|
10005
10006
|
Object.preventExtensions(this);
|
|
10006
10007
|
}
|
|
@@ -10068,6 +10069,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) {
|
|
|
10068
10069
|
workInProgress._debugID = current._debugID;
|
|
10069
10070
|
workInProgress._debugSource = current._debugSource;
|
|
10070
10071
|
workInProgress._debugOwner = current._debugOwner;
|
|
10072
|
+
workInProgress._debugHookTypes = current._debugHookTypes;
|
|
10071
10073
|
}
|
|
10072
10074
|
|
|
10073
10075
|
workInProgress.alternate = current;
|
|
@@ -10335,6 +10337,7 @@ function assignFiberPropertiesInDEV(target, source) {
|
|
|
10335
10337
|
target._debugSource = source._debugSource;
|
|
10336
10338
|
target._debugOwner = source._debugOwner;
|
|
10337
10339
|
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
|
|
10340
|
+
target._debugHookTypes = source._debugHookTypes;
|
|
10338
10341
|
return target;
|
|
10339
10342
|
}
|
|
10340
10343
|
|
|
@@ -12720,7 +12723,6 @@ var currentlyRenderingFiber$1 = null;
|
|
|
12720
12723
|
// current hook list is the list that belongs to the current fiber. The
|
|
12721
12724
|
// work-in-progress hook list is a new list that will be added to the
|
|
12722
12725
|
// work-in-progress fiber.
|
|
12723
|
-
var firstCurrentHook = null;
|
|
12724
12726
|
var currentHook = null;
|
|
12725
12727
|
var nextCurrentHook = null;
|
|
12726
12728
|
var firstWorkInProgressHook = null;
|
|
@@ -12750,39 +12752,67 @@ var RE_RENDER_LIMIT = 25;
|
|
|
12750
12752
|
// In DEV, this is the name of the currently executing primitive hook
|
|
12751
12753
|
var currentHookNameInDev = null;
|
|
12752
12754
|
|
|
12753
|
-
|
|
12755
|
+
// In DEV, this list ensures that hooks are called in the same order between renders.
|
|
12756
|
+
// The list stores the order of hooks used during the initial render (mount).
|
|
12757
|
+
// Subsequent renders (updates) reference this list.
|
|
12758
|
+
var hookTypesDev = null;
|
|
12759
|
+
var hookTypesUpdateIndexDev = -1;
|
|
12760
|
+
|
|
12761
|
+
function mountHookTypesDev() {
|
|
12762
|
+
{
|
|
12763
|
+
var hookName = currentHookNameInDev;
|
|
12764
|
+
|
|
12765
|
+
if (hookTypesDev === null) {
|
|
12766
|
+
hookTypesDev = [hookName];
|
|
12767
|
+
} else {
|
|
12768
|
+
hookTypesDev.push(hookName);
|
|
12769
|
+
}
|
|
12770
|
+
}
|
|
12771
|
+
}
|
|
12772
|
+
|
|
12773
|
+
function updateHookTypesDev() {
|
|
12774
|
+
{
|
|
12775
|
+
var hookName = currentHookNameInDev;
|
|
12776
|
+
|
|
12777
|
+
if (hookTypesDev !== null) {
|
|
12778
|
+
hookTypesUpdateIndexDev++;
|
|
12779
|
+
if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
|
|
12780
|
+
warnOnHookMismatchInDev(hookName);
|
|
12781
|
+
}
|
|
12782
|
+
}
|
|
12783
|
+
}
|
|
12784
|
+
}
|
|
12785
|
+
|
|
12786
|
+
function warnOnHookMismatchInDev(currentHookName) {
|
|
12754
12787
|
{
|
|
12755
12788
|
var componentName = getComponentName(currentlyRenderingFiber$1.type);
|
|
12756
12789
|
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
|
|
12757
12790
|
didWarnAboutMismatchedHooksForComponent.add(componentName);
|
|
12758
12791
|
|
|
12759
|
-
|
|
12792
|
+
if (hookTypesDev !== null) {
|
|
12793
|
+
var table = '';
|
|
12760
12794
|
|
|
12761
|
-
|
|
12762
|
-
var prevHook = firstCurrentHook;
|
|
12763
|
-
var nextHook = firstWorkInProgressHook;
|
|
12764
|
-
var n = 1;
|
|
12765
|
-
while (prevHook !== null && nextHook !== null) {
|
|
12766
|
-
var oldHookName = prevHook._debugType;
|
|
12767
|
-
var newHookName = nextHook._debugType;
|
|
12795
|
+
var secondColumnStart = 30;
|
|
12768
12796
|
|
|
12769
|
-
var
|
|
12797
|
+
for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
|
|
12798
|
+
var oldHookName = hookTypesDev[i];
|
|
12799
|
+
var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
|
|
12770
12800
|
|
|
12771
|
-
|
|
12772
|
-
// lol @ IE not supporting String#repeat
|
|
12773
|
-
while (row.length < secondColumnStart) {
|
|
12774
|
-
row += ' ';
|
|
12775
|
-
}
|
|
12801
|
+
var row = i + 1 + '. ' + oldHookName;
|
|
12776
12802
|
|
|
12777
|
-
|
|
12803
|
+
// Extra space so second column lines up
|
|
12804
|
+
// lol @ IE not supporting String#repeat
|
|
12805
|
+
while (row.length < secondColumnStart) {
|
|
12806
|
+
row += ' ';
|
|
12807
|
+
}
|
|
12778
12808
|
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
}
|
|
12809
|
+
row += newHookName + '\n';
|
|
12810
|
+
|
|
12811
|
+
table += row;
|
|
12812
|
+
}
|
|
12784
12813
|
|
|
12785
|
-
|
|
12814
|
+
warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
|
|
12815
|
+
}
|
|
12786
12816
|
}
|
|
12787
12817
|
}
|
|
12788
12818
|
}
|
|
@@ -12818,7 +12848,12 @@ function areHookInputsEqual(nextDeps, prevDeps) {
|
|
|
12818
12848
|
function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
|
|
12819
12849
|
renderExpirationTime = nextRenderExpirationTime;
|
|
12820
12850
|
currentlyRenderingFiber$1 = workInProgress;
|
|
12821
|
-
|
|
12851
|
+
nextCurrentHook = current !== null ? current.memoizedState : null;
|
|
12852
|
+
|
|
12853
|
+
{
|
|
12854
|
+
hookTypesDev = current !== null ? current._debugHookTypes : null;
|
|
12855
|
+
hookTypesUpdateIndexDev = -1;
|
|
12856
|
+
}
|
|
12822
12857
|
|
|
12823
12858
|
// The following should have already been reset
|
|
12824
12859
|
// currentHook = null;
|
|
@@ -12832,8 +12867,26 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
12832
12867
|
// numberOfReRenders = 0;
|
|
12833
12868
|
// sideEffectTag = 0;
|
|
12834
12869
|
|
|
12870
|
+
// TODO Warn if no hooks are used at all during mount, then some are used during update.
|
|
12871
|
+
// Currently we will identify the update render as a mount because nextCurrentHook === null.
|
|
12872
|
+
// This is tricky because it's valid for certain types of components (e.g. React.lazy)
|
|
12873
|
+
|
|
12874
|
+
// Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
|
|
12875
|
+
// Non-stateful hooks (e.g. context) don't get added to memoizedState,
|
|
12876
|
+
// so nextCurrentHook would be null during updates and mounts.
|
|
12835
12877
|
{
|
|
12836
|
-
|
|
12878
|
+
if (nextCurrentHook !== null) {
|
|
12879
|
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
|
|
12880
|
+
} else if (hookTypesDev !== null) {
|
|
12881
|
+
// This dispatcher handles an edge case where a component is updating,
|
|
12882
|
+
// but no stateful hooks have been used.
|
|
12883
|
+
// We want to match the production code behavior (which will use HooksDispatcherOnMount),
|
|
12884
|
+
// but with the extra DEV validation to ensure hooks ordering hasn't changed.
|
|
12885
|
+
// This dispatcher does that.
|
|
12886
|
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
|
|
12887
|
+
} else {
|
|
12888
|
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
|
|
12889
|
+
}
|
|
12837
12890
|
}
|
|
12838
12891
|
|
|
12839
12892
|
var children = Component(props, refOrContext);
|
|
@@ -12844,13 +12897,18 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
12844
12897
|
numberOfReRenders += 1;
|
|
12845
12898
|
|
|
12846
12899
|
// Start over from the beginning of the list
|
|
12847
|
-
|
|
12900
|
+
nextCurrentHook = current !== null ? current.memoizedState : null;
|
|
12848
12901
|
nextWorkInProgressHook = firstWorkInProgressHook;
|
|
12849
12902
|
|
|
12850
12903
|
currentHook = null;
|
|
12851
12904
|
workInProgressHook = null;
|
|
12852
12905
|
componentUpdateQueue = null;
|
|
12853
12906
|
|
|
12907
|
+
{
|
|
12908
|
+
// Also validate hook order for cascading updates.
|
|
12909
|
+
hookTypesUpdateIndexDev = -1;
|
|
12910
|
+
}
|
|
12911
|
+
|
|
12854
12912
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
|
|
12855
12913
|
|
|
12856
12914
|
children = Component(props, refOrContext);
|
|
@@ -12860,10 +12918,6 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
12860
12918
|
numberOfReRenders = 0;
|
|
12861
12919
|
}
|
|
12862
12920
|
|
|
12863
|
-
{
|
|
12864
|
-
currentHookNameInDev = null;
|
|
12865
|
-
}
|
|
12866
|
-
|
|
12867
12921
|
// We can assume the previous dispatcher is always this one, since we set it
|
|
12868
12922
|
// at the beginning of the render phase and there's no re-entrancy.
|
|
12869
12923
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
@@ -12875,18 +12929,29 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
12875
12929
|
renderedWork.updateQueue = componentUpdateQueue;
|
|
12876
12930
|
renderedWork.effectTag |= sideEffectTag;
|
|
12877
12931
|
|
|
12932
|
+
{
|
|
12933
|
+
renderedWork._debugHookTypes = hookTypesDev;
|
|
12934
|
+
}
|
|
12935
|
+
|
|
12936
|
+
// This check uses currentHook so that it works the same in DEV and prod bundles.
|
|
12937
|
+
// hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
|
|
12878
12938
|
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
|
|
12879
12939
|
|
|
12880
12940
|
renderExpirationTime = NoWork;
|
|
12881
12941
|
currentlyRenderingFiber$1 = null;
|
|
12882
12942
|
|
|
12883
|
-
firstCurrentHook = null;
|
|
12884
12943
|
currentHook = null;
|
|
12885
12944
|
nextCurrentHook = null;
|
|
12886
12945
|
firstWorkInProgressHook = null;
|
|
12887
12946
|
workInProgressHook = null;
|
|
12888
12947
|
nextWorkInProgressHook = null;
|
|
12889
12948
|
|
|
12949
|
+
{
|
|
12950
|
+
currentHookNameInDev = null;
|
|
12951
|
+
hookTypesDev = null;
|
|
12952
|
+
hookTypesUpdateIndexDev = -1;
|
|
12953
|
+
}
|
|
12954
|
+
|
|
12890
12955
|
remainingExpirationTime = NoWork;
|
|
12891
12956
|
componentUpdateQueue = null;
|
|
12892
12957
|
sideEffectTag = 0;
|
|
@@ -12920,21 +12985,23 @@ function resetHooks() {
|
|
|
12920
12985
|
renderExpirationTime = NoWork;
|
|
12921
12986
|
currentlyRenderingFiber$1 = null;
|
|
12922
12987
|
|
|
12923
|
-
firstCurrentHook = null;
|
|
12924
12988
|
currentHook = null;
|
|
12925
12989
|
nextCurrentHook = null;
|
|
12926
12990
|
firstWorkInProgressHook = null;
|
|
12927
12991
|
workInProgressHook = null;
|
|
12928
12992
|
nextWorkInProgressHook = null;
|
|
12929
12993
|
|
|
12930
|
-
remainingExpirationTime = NoWork;
|
|
12931
|
-
componentUpdateQueue = null;
|
|
12932
|
-
sideEffectTag = 0;
|
|
12933
|
-
|
|
12934
12994
|
{
|
|
12995
|
+
hookTypesDev = null;
|
|
12996
|
+
hookTypesUpdateIndexDev = -1;
|
|
12997
|
+
|
|
12935
12998
|
currentHookNameInDev = null;
|
|
12936
12999
|
}
|
|
12937
13000
|
|
|
13001
|
+
remainingExpirationTime = NoWork;
|
|
13002
|
+
componentUpdateQueue = null;
|
|
13003
|
+
sideEffectTag = 0;
|
|
13004
|
+
|
|
12938
13005
|
didScheduleRenderPhaseUpdate = false;
|
|
12939
13006
|
renderPhaseUpdates = null;
|
|
12940
13007
|
numberOfReRenders = 0;
|
|
@@ -12951,9 +13018,6 @@ function mountWorkInProgressHook() {
|
|
|
12951
13018
|
next: null
|
|
12952
13019
|
};
|
|
12953
13020
|
|
|
12954
|
-
{
|
|
12955
|
-
hook._debugType = currentHookNameInDev;
|
|
12956
|
-
}
|
|
12957
13021
|
if (workInProgressHook === null) {
|
|
12958
13022
|
// This is the first hook in the list
|
|
12959
13023
|
firstWorkInProgressHook = workInProgressHook = hook;
|
|
@@ -13000,13 +13064,6 @@ function updateWorkInProgressHook() {
|
|
|
13000
13064
|
workInProgressHook = workInProgressHook.next = newHook;
|
|
13001
13065
|
}
|
|
13002
13066
|
nextCurrentHook = currentHook.next;
|
|
13003
|
-
|
|
13004
|
-
{
|
|
13005
|
-
newHook._debugType = currentHookNameInDev;
|
|
13006
|
-
if (currentHookNameInDev !== currentHook._debugType) {
|
|
13007
|
-
warnOnHookMismatchInDev();
|
|
13008
|
-
}
|
|
13009
|
-
}
|
|
13010
13067
|
}
|
|
13011
13068
|
return workInProgressHook;
|
|
13012
13069
|
}
|
|
@@ -13021,20 +13078,6 @@ function basicStateReducer(state, action) {
|
|
|
13021
13078
|
return typeof action === 'function' ? action(state) : action;
|
|
13022
13079
|
}
|
|
13023
13080
|
|
|
13024
|
-
function mountContext(context, observedBits) {
|
|
13025
|
-
{
|
|
13026
|
-
mountWorkInProgressHook();
|
|
13027
|
-
}
|
|
13028
|
-
return readContext(context, observedBits);
|
|
13029
|
-
}
|
|
13030
|
-
|
|
13031
|
-
function updateContext(context, observedBits) {
|
|
13032
|
-
{
|
|
13033
|
-
updateWorkInProgressHook();
|
|
13034
|
-
}
|
|
13035
|
-
return readContext(context, observedBits);
|
|
13036
|
-
}
|
|
13037
|
-
|
|
13038
13081
|
function mountReducer(reducer, initialArg, init) {
|
|
13039
13082
|
var hook = mountWorkInProgressHook();
|
|
13040
13083
|
var initialState = void 0;
|
|
@@ -13527,6 +13570,7 @@ var ContextOnlyDispatcher = {
|
|
|
13527
13570
|
};
|
|
13528
13571
|
|
|
13529
13572
|
var HooksDispatcherOnMountInDEV = null;
|
|
13573
|
+
var HooksDispatcherOnMountWithHookTypesInDEV = null;
|
|
13530
13574
|
var HooksDispatcherOnUpdateInDEV = null;
|
|
13531
13575
|
var InvalidNestedHooksDispatcherOnMountInDEV = null;
|
|
13532
13576
|
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
@@ -13546,26 +13590,106 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13546
13590
|
},
|
|
13547
13591
|
useCallback: function (callback, deps) {
|
|
13548
13592
|
currentHookNameInDev = 'useCallback';
|
|
13593
|
+
mountHookTypesDev();
|
|
13594
|
+
return mountCallback(callback, deps);
|
|
13595
|
+
},
|
|
13596
|
+
useContext: function (context, observedBits) {
|
|
13597
|
+
currentHookNameInDev = 'useContext';
|
|
13598
|
+
mountHookTypesDev();
|
|
13599
|
+
return readContext(context, observedBits);
|
|
13600
|
+
},
|
|
13601
|
+
useEffect: function (create, deps) {
|
|
13602
|
+
currentHookNameInDev = 'useEffect';
|
|
13603
|
+
mountHookTypesDev();
|
|
13604
|
+
return mountEffect(create, deps);
|
|
13605
|
+
},
|
|
13606
|
+
useImperativeHandle: function (ref, create, deps) {
|
|
13607
|
+
currentHookNameInDev = 'useImperativeHandle';
|
|
13608
|
+
mountHookTypesDev();
|
|
13609
|
+
return mountImperativeHandle(ref, create, deps);
|
|
13610
|
+
},
|
|
13611
|
+
useLayoutEffect: function (create, deps) {
|
|
13612
|
+
currentHookNameInDev = 'useLayoutEffect';
|
|
13613
|
+
mountHookTypesDev();
|
|
13614
|
+
return mountLayoutEffect(create, deps);
|
|
13615
|
+
},
|
|
13616
|
+
useMemo: function (create, deps) {
|
|
13617
|
+
currentHookNameInDev = 'useMemo';
|
|
13618
|
+
mountHookTypesDev();
|
|
13619
|
+
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13620
|
+
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13621
|
+
try {
|
|
13622
|
+
return mountMemo(create, deps);
|
|
13623
|
+
} finally {
|
|
13624
|
+
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
13625
|
+
}
|
|
13626
|
+
},
|
|
13627
|
+
useReducer: function (reducer, initialArg, init) {
|
|
13628
|
+
currentHookNameInDev = 'useReducer';
|
|
13629
|
+
mountHookTypesDev();
|
|
13630
|
+
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13631
|
+
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13632
|
+
try {
|
|
13633
|
+
return mountReducer(reducer, initialArg, init);
|
|
13634
|
+
} finally {
|
|
13635
|
+
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
13636
|
+
}
|
|
13637
|
+
},
|
|
13638
|
+
useRef: function (initialValue) {
|
|
13639
|
+
currentHookNameInDev = 'useRef';
|
|
13640
|
+
mountHookTypesDev();
|
|
13641
|
+
return mountRef(initialValue);
|
|
13642
|
+
},
|
|
13643
|
+
useState: function (initialState) {
|
|
13644
|
+
currentHookNameInDev = 'useState';
|
|
13645
|
+
mountHookTypesDev();
|
|
13646
|
+
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13647
|
+
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13648
|
+
try {
|
|
13649
|
+
return mountState(initialState);
|
|
13650
|
+
} finally {
|
|
13651
|
+
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
13652
|
+
}
|
|
13653
|
+
},
|
|
13654
|
+
useDebugValue: function (value, formatterFn) {
|
|
13655
|
+
currentHookNameInDev = 'useDebugValue';
|
|
13656
|
+
mountHookTypesDev();
|
|
13657
|
+
return mountDebugValue(value, formatterFn);
|
|
13658
|
+
}
|
|
13659
|
+
};
|
|
13660
|
+
|
|
13661
|
+
HooksDispatcherOnMountWithHookTypesInDEV = {
|
|
13662
|
+
readContext: function (context, observedBits) {
|
|
13663
|
+
return readContext(context, observedBits);
|
|
13664
|
+
},
|
|
13665
|
+
useCallback: function (callback, deps) {
|
|
13666
|
+
currentHookNameInDev = 'useCallback';
|
|
13667
|
+
updateHookTypesDev();
|
|
13549
13668
|
return mountCallback(callback, deps);
|
|
13550
13669
|
},
|
|
13551
13670
|
useContext: function (context, observedBits) {
|
|
13552
13671
|
currentHookNameInDev = 'useContext';
|
|
13553
|
-
|
|
13672
|
+
updateHookTypesDev();
|
|
13673
|
+
return readContext(context, observedBits);
|
|
13554
13674
|
},
|
|
13555
13675
|
useEffect: function (create, deps) {
|
|
13556
13676
|
currentHookNameInDev = 'useEffect';
|
|
13677
|
+
updateHookTypesDev();
|
|
13557
13678
|
return mountEffect(create, deps);
|
|
13558
13679
|
},
|
|
13559
13680
|
useImperativeHandle: function (ref, create, deps) {
|
|
13560
13681
|
currentHookNameInDev = 'useImperativeHandle';
|
|
13682
|
+
updateHookTypesDev();
|
|
13561
13683
|
return mountImperativeHandle(ref, create, deps);
|
|
13562
13684
|
},
|
|
13563
13685
|
useLayoutEffect: function (create, deps) {
|
|
13564
13686
|
currentHookNameInDev = 'useLayoutEffect';
|
|
13687
|
+
updateHookTypesDev();
|
|
13565
13688
|
return mountLayoutEffect(create, deps);
|
|
13566
13689
|
},
|
|
13567
13690
|
useMemo: function (create, deps) {
|
|
13568
13691
|
currentHookNameInDev = 'useMemo';
|
|
13692
|
+
updateHookTypesDev();
|
|
13569
13693
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13570
13694
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13571
13695
|
try {
|
|
@@ -13576,6 +13700,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13576
13700
|
},
|
|
13577
13701
|
useReducer: function (reducer, initialArg, init) {
|
|
13578
13702
|
currentHookNameInDev = 'useReducer';
|
|
13703
|
+
updateHookTypesDev();
|
|
13579
13704
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13580
13705
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13581
13706
|
try {
|
|
@@ -13586,10 +13711,12 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13586
13711
|
},
|
|
13587
13712
|
useRef: function (initialValue) {
|
|
13588
13713
|
currentHookNameInDev = 'useRef';
|
|
13714
|
+
updateHookTypesDev();
|
|
13589
13715
|
return mountRef(initialValue);
|
|
13590
13716
|
},
|
|
13591
13717
|
useState: function (initialState) {
|
|
13592
13718
|
currentHookNameInDev = 'useState';
|
|
13719
|
+
updateHookTypesDev();
|
|
13593
13720
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13594
13721
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13595
13722
|
try {
|
|
@@ -13600,6 +13727,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13600
13727
|
},
|
|
13601
13728
|
useDebugValue: function (value, formatterFn) {
|
|
13602
13729
|
currentHookNameInDev = 'useDebugValue';
|
|
13730
|
+
updateHookTypesDev();
|
|
13603
13731
|
return mountDebugValue(value, formatterFn);
|
|
13604
13732
|
}
|
|
13605
13733
|
};
|
|
@@ -13610,26 +13738,32 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13610
13738
|
},
|
|
13611
13739
|
useCallback: function (callback, deps) {
|
|
13612
13740
|
currentHookNameInDev = 'useCallback';
|
|
13741
|
+
updateHookTypesDev();
|
|
13613
13742
|
return updateCallback(callback, deps);
|
|
13614
13743
|
},
|
|
13615
13744
|
useContext: function (context, observedBits) {
|
|
13616
13745
|
currentHookNameInDev = 'useContext';
|
|
13617
|
-
|
|
13746
|
+
updateHookTypesDev();
|
|
13747
|
+
return readContext(context, observedBits);
|
|
13618
13748
|
},
|
|
13619
13749
|
useEffect: function (create, deps) {
|
|
13620
13750
|
currentHookNameInDev = 'useEffect';
|
|
13751
|
+
updateHookTypesDev();
|
|
13621
13752
|
return updateEffect(create, deps);
|
|
13622
13753
|
},
|
|
13623
13754
|
useImperativeHandle: function (ref, create, deps) {
|
|
13624
13755
|
currentHookNameInDev = 'useImperativeHandle';
|
|
13756
|
+
updateHookTypesDev();
|
|
13625
13757
|
return updateImperativeHandle(ref, create, deps);
|
|
13626
13758
|
},
|
|
13627
13759
|
useLayoutEffect: function (create, deps) {
|
|
13628
13760
|
currentHookNameInDev = 'useLayoutEffect';
|
|
13761
|
+
updateHookTypesDev();
|
|
13629
13762
|
return updateLayoutEffect(create, deps);
|
|
13630
13763
|
},
|
|
13631
13764
|
useMemo: function (create, deps) {
|
|
13632
13765
|
currentHookNameInDev = 'useMemo';
|
|
13766
|
+
updateHookTypesDev();
|
|
13633
13767
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13634
13768
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
13635
13769
|
try {
|
|
@@ -13640,6 +13774,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13640
13774
|
},
|
|
13641
13775
|
useReducer: function (reducer, initialArg, init) {
|
|
13642
13776
|
currentHookNameInDev = 'useReducer';
|
|
13777
|
+
updateHookTypesDev();
|
|
13643
13778
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13644
13779
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
13645
13780
|
try {
|
|
@@ -13650,10 +13785,12 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13650
13785
|
},
|
|
13651
13786
|
useRef: function (initialValue) {
|
|
13652
13787
|
currentHookNameInDev = 'useRef';
|
|
13788
|
+
updateHookTypesDev();
|
|
13653
13789
|
return updateRef(initialValue);
|
|
13654
13790
|
},
|
|
13655
13791
|
useState: function (initialState) {
|
|
13656
13792
|
currentHookNameInDev = 'useState';
|
|
13793
|
+
updateHookTypesDev();
|
|
13657
13794
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13658
13795
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
13659
13796
|
try {
|
|
@@ -13664,6 +13801,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13664
13801
|
},
|
|
13665
13802
|
useDebugValue: function (value, formatterFn) {
|
|
13666
13803
|
currentHookNameInDev = 'useDebugValue';
|
|
13804
|
+
updateHookTypesDev();
|
|
13667
13805
|
return updateDebugValue(value, formatterFn);
|
|
13668
13806
|
}
|
|
13669
13807
|
};
|
|
@@ -13676,31 +13814,37 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13676
13814
|
useCallback: function (callback, deps) {
|
|
13677
13815
|
currentHookNameInDev = 'useCallback';
|
|
13678
13816
|
warnInvalidHookAccess();
|
|
13817
|
+
mountHookTypesDev();
|
|
13679
13818
|
return mountCallback(callback, deps);
|
|
13680
13819
|
},
|
|
13681
13820
|
useContext: function (context, observedBits) {
|
|
13682
13821
|
currentHookNameInDev = 'useContext';
|
|
13683
13822
|
warnInvalidHookAccess();
|
|
13684
|
-
|
|
13823
|
+
mountHookTypesDev();
|
|
13824
|
+
return readContext(context, observedBits);
|
|
13685
13825
|
},
|
|
13686
13826
|
useEffect: function (create, deps) {
|
|
13687
13827
|
currentHookNameInDev = 'useEffect';
|
|
13688
13828
|
warnInvalidHookAccess();
|
|
13829
|
+
mountHookTypesDev();
|
|
13689
13830
|
return mountEffect(create, deps);
|
|
13690
13831
|
},
|
|
13691
13832
|
useImperativeHandle: function (ref, create, deps) {
|
|
13692
13833
|
currentHookNameInDev = 'useImperativeHandle';
|
|
13693
13834
|
warnInvalidHookAccess();
|
|
13835
|
+
mountHookTypesDev();
|
|
13694
13836
|
return mountImperativeHandle(ref, create, deps);
|
|
13695
13837
|
},
|
|
13696
13838
|
useLayoutEffect: function (create, deps) {
|
|
13697
13839
|
currentHookNameInDev = 'useLayoutEffect';
|
|
13698
13840
|
warnInvalidHookAccess();
|
|
13841
|
+
mountHookTypesDev();
|
|
13699
13842
|
return mountLayoutEffect(create, deps);
|
|
13700
13843
|
},
|
|
13701
13844
|
useMemo: function (create, deps) {
|
|
13702
13845
|
currentHookNameInDev = 'useMemo';
|
|
13703
13846
|
warnInvalidHookAccess();
|
|
13847
|
+
mountHookTypesDev();
|
|
13704
13848
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13705
13849
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13706
13850
|
try {
|
|
@@ -13712,6 +13856,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13712
13856
|
useReducer: function (reducer, initialArg, init) {
|
|
13713
13857
|
currentHookNameInDev = 'useReducer';
|
|
13714
13858
|
warnInvalidHookAccess();
|
|
13859
|
+
mountHookTypesDev();
|
|
13715
13860
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13716
13861
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13717
13862
|
try {
|
|
@@ -13723,11 +13868,13 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13723
13868
|
useRef: function (initialValue) {
|
|
13724
13869
|
currentHookNameInDev = 'useRef';
|
|
13725
13870
|
warnInvalidHookAccess();
|
|
13871
|
+
mountHookTypesDev();
|
|
13726
13872
|
return mountRef(initialValue);
|
|
13727
13873
|
},
|
|
13728
13874
|
useState: function (initialState) {
|
|
13729
13875
|
currentHookNameInDev = 'useState';
|
|
13730
13876
|
warnInvalidHookAccess();
|
|
13877
|
+
mountHookTypesDev();
|
|
13731
13878
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13732
13879
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
13733
13880
|
try {
|
|
@@ -13739,6 +13886,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13739
13886
|
useDebugValue: function (value, formatterFn) {
|
|
13740
13887
|
currentHookNameInDev = 'useDebugValue';
|
|
13741
13888
|
warnInvalidHookAccess();
|
|
13889
|
+
mountHookTypesDev();
|
|
13742
13890
|
return mountDebugValue(value, formatterFn);
|
|
13743
13891
|
}
|
|
13744
13892
|
};
|
|
@@ -13751,31 +13899,37 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13751
13899
|
useCallback: function (callback, deps) {
|
|
13752
13900
|
currentHookNameInDev = 'useCallback';
|
|
13753
13901
|
warnInvalidHookAccess();
|
|
13902
|
+
updateHookTypesDev();
|
|
13754
13903
|
return updateCallback(callback, deps);
|
|
13755
13904
|
},
|
|
13756
13905
|
useContext: function (context, observedBits) {
|
|
13757
13906
|
currentHookNameInDev = 'useContext';
|
|
13758
13907
|
warnInvalidHookAccess();
|
|
13759
|
-
|
|
13908
|
+
updateHookTypesDev();
|
|
13909
|
+
return readContext(context, observedBits);
|
|
13760
13910
|
},
|
|
13761
13911
|
useEffect: function (create, deps) {
|
|
13762
13912
|
currentHookNameInDev = 'useEffect';
|
|
13763
13913
|
warnInvalidHookAccess();
|
|
13914
|
+
updateHookTypesDev();
|
|
13764
13915
|
return updateEffect(create, deps);
|
|
13765
13916
|
},
|
|
13766
13917
|
useImperativeHandle: function (ref, create, deps) {
|
|
13767
13918
|
currentHookNameInDev = 'useImperativeHandle';
|
|
13768
13919
|
warnInvalidHookAccess();
|
|
13920
|
+
updateHookTypesDev();
|
|
13769
13921
|
return updateImperativeHandle(ref, create, deps);
|
|
13770
13922
|
},
|
|
13771
13923
|
useLayoutEffect: function (create, deps) {
|
|
13772
13924
|
currentHookNameInDev = 'useLayoutEffect';
|
|
13773
13925
|
warnInvalidHookAccess();
|
|
13926
|
+
updateHookTypesDev();
|
|
13774
13927
|
return updateLayoutEffect(create, deps);
|
|
13775
13928
|
},
|
|
13776
13929
|
useMemo: function (create, deps) {
|
|
13777
13930
|
currentHookNameInDev = 'useMemo';
|
|
13778
13931
|
warnInvalidHookAccess();
|
|
13932
|
+
updateHookTypesDev();
|
|
13779
13933
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13780
13934
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
13781
13935
|
try {
|
|
@@ -13787,6 +13941,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13787
13941
|
useReducer: function (reducer, initialArg, init) {
|
|
13788
13942
|
currentHookNameInDev = 'useReducer';
|
|
13789
13943
|
warnInvalidHookAccess();
|
|
13944
|
+
updateHookTypesDev();
|
|
13790
13945
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13791
13946
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
13792
13947
|
try {
|
|
@@ -13798,11 +13953,13 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13798
13953
|
useRef: function (initialValue) {
|
|
13799
13954
|
currentHookNameInDev = 'useRef';
|
|
13800
13955
|
warnInvalidHookAccess();
|
|
13956
|
+
updateHookTypesDev();
|
|
13801
13957
|
return updateRef(initialValue);
|
|
13802
13958
|
},
|
|
13803
13959
|
useState: function (initialState) {
|
|
13804
13960
|
currentHookNameInDev = 'useState';
|
|
13805
13961
|
warnInvalidHookAccess();
|
|
13962
|
+
updateHookTypesDev();
|
|
13806
13963
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
13807
13964
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
13808
13965
|
try {
|
|
@@ -13814,6 +13971,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
13814
13971
|
useDebugValue: function (value, formatterFn) {
|
|
13815
13972
|
currentHookNameInDev = 'useDebugValue';
|
|
13816
13973
|
warnInvalidHookAccess();
|
|
13974
|
+
updateHookTypesDev();
|
|
13817
13975
|
return updateDebugValue(value, formatterFn);
|
|
13818
13976
|
}
|
|
13819
13977
|
};
|
|
@@ -20548,7 +20706,7 @@ implementation) {
|
|
|
20548
20706
|
|
|
20549
20707
|
// TODO: this is special because it gets imported during build.
|
|
20550
20708
|
|
|
20551
|
-
var ReactVersion = '16.8.
|
|
20709
|
+
var ReactVersion = '16.8.4';
|
|
20552
20710
|
|
|
20553
20711
|
// TODO: This type is shared between the reconciler and ReactDOM, but will
|
|
20554
20712
|
// eventually be lifted out to the renderer.
|