react-test-renderer 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-test-renderer-shallow.development.js +1 -1
- package/cjs/react-test-renderer-shallow.production.min.js +1 -1
- package/cjs/react-test-renderer.development.js +224 -66
- package/cjs/react-test-renderer.production.min.js +2 -2
- package/package.json +3 -3
- package/umd/react-test-renderer-shallow.development.js +1 -1
- package/umd/react-test-renderer-shallow.production.min.js +1 -1
- package/umd/react-test-renderer.development.js +224 -66
- package/umd/react-test-renderer.production.min.js +2 -2
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"branch": "
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "16.8.4",
|
|
3
|
+
"buildNumber": "13714",
|
|
4
|
+
"checksum": "94d3bf9",
|
|
5
|
+
"commit": "741aa17a3",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.8.
|
|
7
|
+
"reactVersion": "16.8.3-canary-741aa17a3"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.4
|
|
2
2
|
* react-test-renderer.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1865,6 +1865,7 @@ function FiberNode(tag, pendingProps, key, mode) {
|
|
|
1865
1865
|
this._debugSource = null;
|
|
1866
1866
|
this._debugOwner = null;
|
|
1867
1867
|
this._debugIsCurrentlyTiming = false;
|
|
1868
|
+
this._debugHookTypes = null;
|
|
1868
1869
|
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
|
|
1869
1870
|
Object.preventExtensions(this);
|
|
1870
1871
|
}
|
|
@@ -1932,6 +1933,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) {
|
|
|
1932
1933
|
workInProgress._debugID = current._debugID;
|
|
1933
1934
|
workInProgress._debugSource = current._debugSource;
|
|
1934
1935
|
workInProgress._debugOwner = current._debugOwner;
|
|
1936
|
+
workInProgress._debugHookTypes = current._debugHookTypes;
|
|
1935
1937
|
}
|
|
1936
1938
|
|
|
1937
1939
|
workInProgress.alternate = current;
|
|
@@ -2199,6 +2201,7 @@ function assignFiberPropertiesInDEV(target, source) {
|
|
|
2199
2201
|
target._debugSource = source._debugSource;
|
|
2200
2202
|
target._debugOwner = source._debugOwner;
|
|
2201
2203
|
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
|
|
2204
|
+
target._debugHookTypes = source._debugHookTypes;
|
|
2202
2205
|
return target;
|
|
2203
2206
|
}
|
|
2204
2207
|
|
|
@@ -4843,7 +4846,6 @@ var currentlyRenderingFiber$1 = null;
|
|
|
4843
4846
|
// current hook list is the list that belongs to the current fiber. The
|
|
4844
4847
|
// work-in-progress hook list is a new list that will be added to the
|
|
4845
4848
|
// work-in-progress fiber.
|
|
4846
|
-
var firstCurrentHook = null;
|
|
4847
4849
|
var currentHook = null;
|
|
4848
4850
|
var nextCurrentHook = null;
|
|
4849
4851
|
var firstWorkInProgressHook = null;
|
|
@@ -4873,39 +4875,67 @@ var RE_RENDER_LIMIT = 25;
|
|
|
4873
4875
|
// In DEV, this is the name of the currently executing primitive hook
|
|
4874
4876
|
var currentHookNameInDev = null;
|
|
4875
4877
|
|
|
4876
|
-
|
|
4878
|
+
// In DEV, this list ensures that hooks are called in the same order between renders.
|
|
4879
|
+
// The list stores the order of hooks used during the initial render (mount).
|
|
4880
|
+
// Subsequent renders (updates) reference this list.
|
|
4881
|
+
var hookTypesDev = null;
|
|
4882
|
+
var hookTypesUpdateIndexDev = -1;
|
|
4883
|
+
|
|
4884
|
+
function mountHookTypesDev() {
|
|
4885
|
+
{
|
|
4886
|
+
var hookName = currentHookNameInDev;
|
|
4887
|
+
|
|
4888
|
+
if (hookTypesDev === null) {
|
|
4889
|
+
hookTypesDev = [hookName];
|
|
4890
|
+
} else {
|
|
4891
|
+
hookTypesDev.push(hookName);
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4896
|
+
function updateHookTypesDev() {
|
|
4897
|
+
{
|
|
4898
|
+
var hookName = currentHookNameInDev;
|
|
4899
|
+
|
|
4900
|
+
if (hookTypesDev !== null) {
|
|
4901
|
+
hookTypesUpdateIndexDev++;
|
|
4902
|
+
if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
|
|
4903
|
+
warnOnHookMismatchInDev(hookName);
|
|
4904
|
+
}
|
|
4905
|
+
}
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
|
|
4909
|
+
function warnOnHookMismatchInDev(currentHookName) {
|
|
4877
4910
|
{
|
|
4878
4911
|
var componentName = getComponentName(currentlyRenderingFiber$1.type);
|
|
4879
4912
|
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
|
|
4880
4913
|
didWarnAboutMismatchedHooksForComponent.add(componentName);
|
|
4881
4914
|
|
|
4882
|
-
|
|
4915
|
+
if (hookTypesDev !== null) {
|
|
4916
|
+
var table = '';
|
|
4883
4917
|
|
|
4884
|
-
|
|
4885
|
-
var prevHook = firstCurrentHook;
|
|
4886
|
-
var nextHook = firstWorkInProgressHook;
|
|
4887
|
-
var n = 1;
|
|
4888
|
-
while (prevHook !== null && nextHook !== null) {
|
|
4889
|
-
var oldHookName = prevHook._debugType;
|
|
4890
|
-
var newHookName = nextHook._debugType;
|
|
4918
|
+
var secondColumnStart = 30;
|
|
4891
4919
|
|
|
4892
|
-
var
|
|
4920
|
+
for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
|
|
4921
|
+
var oldHookName = hookTypesDev[i];
|
|
4922
|
+
var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
|
|
4893
4923
|
|
|
4894
|
-
|
|
4895
|
-
// lol @ IE not supporting String#repeat
|
|
4896
|
-
while (row.length < secondColumnStart) {
|
|
4897
|
-
row += ' ';
|
|
4898
|
-
}
|
|
4924
|
+
var row = i + 1 + '. ' + oldHookName;
|
|
4899
4925
|
|
|
4900
|
-
|
|
4926
|
+
// Extra space so second column lines up
|
|
4927
|
+
// lol @ IE not supporting String#repeat
|
|
4928
|
+
while (row.length < secondColumnStart) {
|
|
4929
|
+
row += ' ';
|
|
4930
|
+
}
|
|
4901
4931
|
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
}
|
|
4932
|
+
row += newHookName + '\n';
|
|
4933
|
+
|
|
4934
|
+
table += row;
|
|
4935
|
+
}
|
|
4907
4936
|
|
|
4908
|
-
|
|
4937
|
+
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);
|
|
4938
|
+
}
|
|
4909
4939
|
}
|
|
4910
4940
|
}
|
|
4911
4941
|
}
|
|
@@ -4941,7 +4971,12 @@ function areHookInputsEqual(nextDeps, prevDeps) {
|
|
|
4941
4971
|
function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
|
|
4942
4972
|
renderExpirationTime = nextRenderExpirationTime;
|
|
4943
4973
|
currentlyRenderingFiber$1 = workInProgress;
|
|
4944
|
-
|
|
4974
|
+
nextCurrentHook = current !== null ? current.memoizedState : null;
|
|
4975
|
+
|
|
4976
|
+
{
|
|
4977
|
+
hookTypesDev = current !== null ? current._debugHookTypes : null;
|
|
4978
|
+
hookTypesUpdateIndexDev = -1;
|
|
4979
|
+
}
|
|
4945
4980
|
|
|
4946
4981
|
// The following should have already been reset
|
|
4947
4982
|
// currentHook = null;
|
|
@@ -4955,8 +4990,26 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
4955
4990
|
// numberOfReRenders = 0;
|
|
4956
4991
|
// sideEffectTag = 0;
|
|
4957
4992
|
|
|
4993
|
+
// TODO Warn if no hooks are used at all during mount, then some are used during update.
|
|
4994
|
+
// Currently we will identify the update render as a mount because nextCurrentHook === null.
|
|
4995
|
+
// This is tricky because it's valid for certain types of components (e.g. React.lazy)
|
|
4996
|
+
|
|
4997
|
+
// Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
|
|
4998
|
+
// Non-stateful hooks (e.g. context) don't get added to memoizedState,
|
|
4999
|
+
// so nextCurrentHook would be null during updates and mounts.
|
|
4958
5000
|
{
|
|
4959
|
-
|
|
5001
|
+
if (nextCurrentHook !== null) {
|
|
5002
|
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
|
|
5003
|
+
} else if (hookTypesDev !== null) {
|
|
5004
|
+
// This dispatcher handles an edge case where a component is updating,
|
|
5005
|
+
// but no stateful hooks have been used.
|
|
5006
|
+
// We want to match the production code behavior (which will use HooksDispatcherOnMount),
|
|
5007
|
+
// but with the extra DEV validation to ensure hooks ordering hasn't changed.
|
|
5008
|
+
// This dispatcher does that.
|
|
5009
|
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
|
|
5010
|
+
} else {
|
|
5011
|
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
|
|
5012
|
+
}
|
|
4960
5013
|
}
|
|
4961
5014
|
|
|
4962
5015
|
var children = Component(props, refOrContext);
|
|
@@ -4967,13 +5020,18 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
4967
5020
|
numberOfReRenders += 1;
|
|
4968
5021
|
|
|
4969
5022
|
// Start over from the beginning of the list
|
|
4970
|
-
|
|
5023
|
+
nextCurrentHook = current !== null ? current.memoizedState : null;
|
|
4971
5024
|
nextWorkInProgressHook = firstWorkInProgressHook;
|
|
4972
5025
|
|
|
4973
5026
|
currentHook = null;
|
|
4974
5027
|
workInProgressHook = null;
|
|
4975
5028
|
componentUpdateQueue = null;
|
|
4976
5029
|
|
|
5030
|
+
{
|
|
5031
|
+
// Also validate hook order for cascading updates.
|
|
5032
|
+
hookTypesUpdateIndexDev = -1;
|
|
5033
|
+
}
|
|
5034
|
+
|
|
4977
5035
|
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
|
|
4978
5036
|
|
|
4979
5037
|
children = Component(props, refOrContext);
|
|
@@ -4983,10 +5041,6 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
4983
5041
|
numberOfReRenders = 0;
|
|
4984
5042
|
}
|
|
4985
5043
|
|
|
4986
|
-
{
|
|
4987
|
-
currentHookNameInDev = null;
|
|
4988
|
-
}
|
|
4989
|
-
|
|
4990
5044
|
// We can assume the previous dispatcher is always this one, since we set it
|
|
4991
5045
|
// at the beginning of the render phase and there's no re-entrancy.
|
|
4992
5046
|
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
|
@@ -4998,18 +5052,29 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
|
|
|
4998
5052
|
renderedWork.updateQueue = componentUpdateQueue;
|
|
4999
5053
|
renderedWork.effectTag |= sideEffectTag;
|
|
5000
5054
|
|
|
5055
|
+
{
|
|
5056
|
+
renderedWork._debugHookTypes = hookTypesDev;
|
|
5057
|
+
}
|
|
5058
|
+
|
|
5059
|
+
// This check uses currentHook so that it works the same in DEV and prod bundles.
|
|
5060
|
+
// hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
|
|
5001
5061
|
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
|
|
5002
5062
|
|
|
5003
5063
|
renderExpirationTime = NoWork;
|
|
5004
5064
|
currentlyRenderingFiber$1 = null;
|
|
5005
5065
|
|
|
5006
|
-
firstCurrentHook = null;
|
|
5007
5066
|
currentHook = null;
|
|
5008
5067
|
nextCurrentHook = null;
|
|
5009
5068
|
firstWorkInProgressHook = null;
|
|
5010
5069
|
workInProgressHook = null;
|
|
5011
5070
|
nextWorkInProgressHook = null;
|
|
5012
5071
|
|
|
5072
|
+
{
|
|
5073
|
+
currentHookNameInDev = null;
|
|
5074
|
+
hookTypesDev = null;
|
|
5075
|
+
hookTypesUpdateIndexDev = -1;
|
|
5076
|
+
}
|
|
5077
|
+
|
|
5013
5078
|
remainingExpirationTime = NoWork;
|
|
5014
5079
|
componentUpdateQueue = null;
|
|
5015
5080
|
sideEffectTag = 0;
|
|
@@ -5043,21 +5108,23 @@ function resetHooks() {
|
|
|
5043
5108
|
renderExpirationTime = NoWork;
|
|
5044
5109
|
currentlyRenderingFiber$1 = null;
|
|
5045
5110
|
|
|
5046
|
-
firstCurrentHook = null;
|
|
5047
5111
|
currentHook = null;
|
|
5048
5112
|
nextCurrentHook = null;
|
|
5049
5113
|
firstWorkInProgressHook = null;
|
|
5050
5114
|
workInProgressHook = null;
|
|
5051
5115
|
nextWorkInProgressHook = null;
|
|
5052
5116
|
|
|
5053
|
-
remainingExpirationTime = NoWork;
|
|
5054
|
-
componentUpdateQueue = null;
|
|
5055
|
-
sideEffectTag = 0;
|
|
5056
|
-
|
|
5057
5117
|
{
|
|
5118
|
+
hookTypesDev = null;
|
|
5119
|
+
hookTypesUpdateIndexDev = -1;
|
|
5120
|
+
|
|
5058
5121
|
currentHookNameInDev = null;
|
|
5059
5122
|
}
|
|
5060
5123
|
|
|
5124
|
+
remainingExpirationTime = NoWork;
|
|
5125
|
+
componentUpdateQueue = null;
|
|
5126
|
+
sideEffectTag = 0;
|
|
5127
|
+
|
|
5061
5128
|
didScheduleRenderPhaseUpdate = false;
|
|
5062
5129
|
renderPhaseUpdates = null;
|
|
5063
5130
|
numberOfReRenders = 0;
|
|
@@ -5074,9 +5141,6 @@ function mountWorkInProgressHook() {
|
|
|
5074
5141
|
next: null
|
|
5075
5142
|
};
|
|
5076
5143
|
|
|
5077
|
-
{
|
|
5078
|
-
hook._debugType = currentHookNameInDev;
|
|
5079
|
-
}
|
|
5080
5144
|
if (workInProgressHook === null) {
|
|
5081
5145
|
// This is the first hook in the list
|
|
5082
5146
|
firstWorkInProgressHook = workInProgressHook = hook;
|
|
@@ -5123,13 +5187,6 @@ function updateWorkInProgressHook() {
|
|
|
5123
5187
|
workInProgressHook = workInProgressHook.next = newHook;
|
|
5124
5188
|
}
|
|
5125
5189
|
nextCurrentHook = currentHook.next;
|
|
5126
|
-
|
|
5127
|
-
{
|
|
5128
|
-
newHook._debugType = currentHookNameInDev;
|
|
5129
|
-
if (currentHookNameInDev !== currentHook._debugType) {
|
|
5130
|
-
warnOnHookMismatchInDev();
|
|
5131
|
-
}
|
|
5132
|
-
}
|
|
5133
5190
|
}
|
|
5134
5191
|
return workInProgressHook;
|
|
5135
5192
|
}
|
|
@@ -5144,20 +5201,6 @@ function basicStateReducer(state, action) {
|
|
|
5144
5201
|
return typeof action === 'function' ? action(state) : action;
|
|
5145
5202
|
}
|
|
5146
5203
|
|
|
5147
|
-
function mountContext(context, observedBits) {
|
|
5148
|
-
{
|
|
5149
|
-
mountWorkInProgressHook();
|
|
5150
|
-
}
|
|
5151
|
-
return readContext(context, observedBits);
|
|
5152
|
-
}
|
|
5153
|
-
|
|
5154
|
-
function updateContext(context, observedBits) {
|
|
5155
|
-
{
|
|
5156
|
-
updateWorkInProgressHook();
|
|
5157
|
-
}
|
|
5158
|
-
return readContext(context, observedBits);
|
|
5159
|
-
}
|
|
5160
|
-
|
|
5161
5204
|
function mountReducer(reducer, initialArg, init) {
|
|
5162
5205
|
var hook = mountWorkInProgressHook();
|
|
5163
5206
|
var initialState = void 0;
|
|
@@ -5650,6 +5693,7 @@ var ContextOnlyDispatcher = {
|
|
|
5650
5693
|
};
|
|
5651
5694
|
|
|
5652
5695
|
var HooksDispatcherOnMountInDEV = null;
|
|
5696
|
+
var HooksDispatcherOnMountWithHookTypesInDEV = null;
|
|
5653
5697
|
var HooksDispatcherOnUpdateInDEV = null;
|
|
5654
5698
|
var InvalidNestedHooksDispatcherOnMountInDEV = null;
|
|
5655
5699
|
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
@@ -5669,26 +5713,106 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5669
5713
|
},
|
|
5670
5714
|
useCallback: function (callback, deps) {
|
|
5671
5715
|
currentHookNameInDev = 'useCallback';
|
|
5716
|
+
mountHookTypesDev();
|
|
5717
|
+
return mountCallback(callback, deps);
|
|
5718
|
+
},
|
|
5719
|
+
useContext: function (context, observedBits) {
|
|
5720
|
+
currentHookNameInDev = 'useContext';
|
|
5721
|
+
mountHookTypesDev();
|
|
5722
|
+
return readContext(context, observedBits);
|
|
5723
|
+
},
|
|
5724
|
+
useEffect: function (create, deps) {
|
|
5725
|
+
currentHookNameInDev = 'useEffect';
|
|
5726
|
+
mountHookTypesDev();
|
|
5727
|
+
return mountEffect(create, deps);
|
|
5728
|
+
},
|
|
5729
|
+
useImperativeHandle: function (ref, create, deps) {
|
|
5730
|
+
currentHookNameInDev = 'useImperativeHandle';
|
|
5731
|
+
mountHookTypesDev();
|
|
5732
|
+
return mountImperativeHandle(ref, create, deps);
|
|
5733
|
+
},
|
|
5734
|
+
useLayoutEffect: function (create, deps) {
|
|
5735
|
+
currentHookNameInDev = 'useLayoutEffect';
|
|
5736
|
+
mountHookTypesDev();
|
|
5737
|
+
return mountLayoutEffect(create, deps);
|
|
5738
|
+
},
|
|
5739
|
+
useMemo: function (create, deps) {
|
|
5740
|
+
currentHookNameInDev = 'useMemo';
|
|
5741
|
+
mountHookTypesDev();
|
|
5742
|
+
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5743
|
+
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5744
|
+
try {
|
|
5745
|
+
return mountMemo(create, deps);
|
|
5746
|
+
} finally {
|
|
5747
|
+
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
5748
|
+
}
|
|
5749
|
+
},
|
|
5750
|
+
useReducer: function (reducer, initialArg, init) {
|
|
5751
|
+
currentHookNameInDev = 'useReducer';
|
|
5752
|
+
mountHookTypesDev();
|
|
5753
|
+
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5754
|
+
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5755
|
+
try {
|
|
5756
|
+
return mountReducer(reducer, initialArg, init);
|
|
5757
|
+
} finally {
|
|
5758
|
+
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
5759
|
+
}
|
|
5760
|
+
},
|
|
5761
|
+
useRef: function (initialValue) {
|
|
5762
|
+
currentHookNameInDev = 'useRef';
|
|
5763
|
+
mountHookTypesDev();
|
|
5764
|
+
return mountRef(initialValue);
|
|
5765
|
+
},
|
|
5766
|
+
useState: function (initialState) {
|
|
5767
|
+
currentHookNameInDev = 'useState';
|
|
5768
|
+
mountHookTypesDev();
|
|
5769
|
+
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5770
|
+
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5771
|
+
try {
|
|
5772
|
+
return mountState(initialState);
|
|
5773
|
+
} finally {
|
|
5774
|
+
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
5775
|
+
}
|
|
5776
|
+
},
|
|
5777
|
+
useDebugValue: function (value, formatterFn) {
|
|
5778
|
+
currentHookNameInDev = 'useDebugValue';
|
|
5779
|
+
mountHookTypesDev();
|
|
5780
|
+
return mountDebugValue(value, formatterFn);
|
|
5781
|
+
}
|
|
5782
|
+
};
|
|
5783
|
+
|
|
5784
|
+
HooksDispatcherOnMountWithHookTypesInDEV = {
|
|
5785
|
+
readContext: function (context, observedBits) {
|
|
5786
|
+
return readContext(context, observedBits);
|
|
5787
|
+
},
|
|
5788
|
+
useCallback: function (callback, deps) {
|
|
5789
|
+
currentHookNameInDev = 'useCallback';
|
|
5790
|
+
updateHookTypesDev();
|
|
5672
5791
|
return mountCallback(callback, deps);
|
|
5673
5792
|
},
|
|
5674
5793
|
useContext: function (context, observedBits) {
|
|
5675
5794
|
currentHookNameInDev = 'useContext';
|
|
5676
|
-
|
|
5795
|
+
updateHookTypesDev();
|
|
5796
|
+
return readContext(context, observedBits);
|
|
5677
5797
|
},
|
|
5678
5798
|
useEffect: function (create, deps) {
|
|
5679
5799
|
currentHookNameInDev = 'useEffect';
|
|
5800
|
+
updateHookTypesDev();
|
|
5680
5801
|
return mountEffect(create, deps);
|
|
5681
5802
|
},
|
|
5682
5803
|
useImperativeHandle: function (ref, create, deps) {
|
|
5683
5804
|
currentHookNameInDev = 'useImperativeHandle';
|
|
5805
|
+
updateHookTypesDev();
|
|
5684
5806
|
return mountImperativeHandle(ref, create, deps);
|
|
5685
5807
|
},
|
|
5686
5808
|
useLayoutEffect: function (create, deps) {
|
|
5687
5809
|
currentHookNameInDev = 'useLayoutEffect';
|
|
5810
|
+
updateHookTypesDev();
|
|
5688
5811
|
return mountLayoutEffect(create, deps);
|
|
5689
5812
|
},
|
|
5690
5813
|
useMemo: function (create, deps) {
|
|
5691
5814
|
currentHookNameInDev = 'useMemo';
|
|
5815
|
+
updateHookTypesDev();
|
|
5692
5816
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5693
5817
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5694
5818
|
try {
|
|
@@ -5699,6 +5823,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5699
5823
|
},
|
|
5700
5824
|
useReducer: function (reducer, initialArg, init) {
|
|
5701
5825
|
currentHookNameInDev = 'useReducer';
|
|
5826
|
+
updateHookTypesDev();
|
|
5702
5827
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5703
5828
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5704
5829
|
try {
|
|
@@ -5709,10 +5834,12 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5709
5834
|
},
|
|
5710
5835
|
useRef: function (initialValue) {
|
|
5711
5836
|
currentHookNameInDev = 'useRef';
|
|
5837
|
+
updateHookTypesDev();
|
|
5712
5838
|
return mountRef(initialValue);
|
|
5713
5839
|
},
|
|
5714
5840
|
useState: function (initialState) {
|
|
5715
5841
|
currentHookNameInDev = 'useState';
|
|
5842
|
+
updateHookTypesDev();
|
|
5716
5843
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5717
5844
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5718
5845
|
try {
|
|
@@ -5723,6 +5850,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5723
5850
|
},
|
|
5724
5851
|
useDebugValue: function (value, formatterFn) {
|
|
5725
5852
|
currentHookNameInDev = 'useDebugValue';
|
|
5853
|
+
updateHookTypesDev();
|
|
5726
5854
|
return mountDebugValue(value, formatterFn);
|
|
5727
5855
|
}
|
|
5728
5856
|
};
|
|
@@ -5733,26 +5861,32 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5733
5861
|
},
|
|
5734
5862
|
useCallback: function (callback, deps) {
|
|
5735
5863
|
currentHookNameInDev = 'useCallback';
|
|
5864
|
+
updateHookTypesDev();
|
|
5736
5865
|
return updateCallback(callback, deps);
|
|
5737
5866
|
},
|
|
5738
5867
|
useContext: function (context, observedBits) {
|
|
5739
5868
|
currentHookNameInDev = 'useContext';
|
|
5740
|
-
|
|
5869
|
+
updateHookTypesDev();
|
|
5870
|
+
return readContext(context, observedBits);
|
|
5741
5871
|
},
|
|
5742
5872
|
useEffect: function (create, deps) {
|
|
5743
5873
|
currentHookNameInDev = 'useEffect';
|
|
5874
|
+
updateHookTypesDev();
|
|
5744
5875
|
return updateEffect(create, deps);
|
|
5745
5876
|
},
|
|
5746
5877
|
useImperativeHandle: function (ref, create, deps) {
|
|
5747
5878
|
currentHookNameInDev = 'useImperativeHandle';
|
|
5879
|
+
updateHookTypesDev();
|
|
5748
5880
|
return updateImperativeHandle(ref, create, deps);
|
|
5749
5881
|
},
|
|
5750
5882
|
useLayoutEffect: function (create, deps) {
|
|
5751
5883
|
currentHookNameInDev = 'useLayoutEffect';
|
|
5884
|
+
updateHookTypesDev();
|
|
5752
5885
|
return updateLayoutEffect(create, deps);
|
|
5753
5886
|
},
|
|
5754
5887
|
useMemo: function (create, deps) {
|
|
5755
5888
|
currentHookNameInDev = 'useMemo';
|
|
5889
|
+
updateHookTypesDev();
|
|
5756
5890
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5757
5891
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
5758
5892
|
try {
|
|
@@ -5763,6 +5897,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5763
5897
|
},
|
|
5764
5898
|
useReducer: function (reducer, initialArg, init) {
|
|
5765
5899
|
currentHookNameInDev = 'useReducer';
|
|
5900
|
+
updateHookTypesDev();
|
|
5766
5901
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5767
5902
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
5768
5903
|
try {
|
|
@@ -5773,10 +5908,12 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5773
5908
|
},
|
|
5774
5909
|
useRef: function (initialValue) {
|
|
5775
5910
|
currentHookNameInDev = 'useRef';
|
|
5911
|
+
updateHookTypesDev();
|
|
5776
5912
|
return updateRef(initialValue);
|
|
5777
5913
|
},
|
|
5778
5914
|
useState: function (initialState) {
|
|
5779
5915
|
currentHookNameInDev = 'useState';
|
|
5916
|
+
updateHookTypesDev();
|
|
5780
5917
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5781
5918
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
5782
5919
|
try {
|
|
@@ -5787,6 +5924,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5787
5924
|
},
|
|
5788
5925
|
useDebugValue: function (value, formatterFn) {
|
|
5789
5926
|
currentHookNameInDev = 'useDebugValue';
|
|
5927
|
+
updateHookTypesDev();
|
|
5790
5928
|
return updateDebugValue(value, formatterFn);
|
|
5791
5929
|
}
|
|
5792
5930
|
};
|
|
@@ -5799,31 +5937,37 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5799
5937
|
useCallback: function (callback, deps) {
|
|
5800
5938
|
currentHookNameInDev = 'useCallback';
|
|
5801
5939
|
warnInvalidHookAccess();
|
|
5940
|
+
mountHookTypesDev();
|
|
5802
5941
|
return mountCallback(callback, deps);
|
|
5803
5942
|
},
|
|
5804
5943
|
useContext: function (context, observedBits) {
|
|
5805
5944
|
currentHookNameInDev = 'useContext';
|
|
5806
5945
|
warnInvalidHookAccess();
|
|
5807
|
-
|
|
5946
|
+
mountHookTypesDev();
|
|
5947
|
+
return readContext(context, observedBits);
|
|
5808
5948
|
},
|
|
5809
5949
|
useEffect: function (create, deps) {
|
|
5810
5950
|
currentHookNameInDev = 'useEffect';
|
|
5811
5951
|
warnInvalidHookAccess();
|
|
5952
|
+
mountHookTypesDev();
|
|
5812
5953
|
return mountEffect(create, deps);
|
|
5813
5954
|
},
|
|
5814
5955
|
useImperativeHandle: function (ref, create, deps) {
|
|
5815
5956
|
currentHookNameInDev = 'useImperativeHandle';
|
|
5816
5957
|
warnInvalidHookAccess();
|
|
5958
|
+
mountHookTypesDev();
|
|
5817
5959
|
return mountImperativeHandle(ref, create, deps);
|
|
5818
5960
|
},
|
|
5819
5961
|
useLayoutEffect: function (create, deps) {
|
|
5820
5962
|
currentHookNameInDev = 'useLayoutEffect';
|
|
5821
5963
|
warnInvalidHookAccess();
|
|
5964
|
+
mountHookTypesDev();
|
|
5822
5965
|
return mountLayoutEffect(create, deps);
|
|
5823
5966
|
},
|
|
5824
5967
|
useMemo: function (create, deps) {
|
|
5825
5968
|
currentHookNameInDev = 'useMemo';
|
|
5826
5969
|
warnInvalidHookAccess();
|
|
5970
|
+
mountHookTypesDev();
|
|
5827
5971
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5828
5972
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5829
5973
|
try {
|
|
@@ -5835,6 +5979,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5835
5979
|
useReducer: function (reducer, initialArg, init) {
|
|
5836
5980
|
currentHookNameInDev = 'useReducer';
|
|
5837
5981
|
warnInvalidHookAccess();
|
|
5982
|
+
mountHookTypesDev();
|
|
5838
5983
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5839
5984
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5840
5985
|
try {
|
|
@@ -5846,11 +5991,13 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5846
5991
|
useRef: function (initialValue) {
|
|
5847
5992
|
currentHookNameInDev = 'useRef';
|
|
5848
5993
|
warnInvalidHookAccess();
|
|
5994
|
+
mountHookTypesDev();
|
|
5849
5995
|
return mountRef(initialValue);
|
|
5850
5996
|
},
|
|
5851
5997
|
useState: function (initialState) {
|
|
5852
5998
|
currentHookNameInDev = 'useState';
|
|
5853
5999
|
warnInvalidHookAccess();
|
|
6000
|
+
mountHookTypesDev();
|
|
5854
6001
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5855
6002
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
5856
6003
|
try {
|
|
@@ -5862,6 +6009,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5862
6009
|
useDebugValue: function (value, formatterFn) {
|
|
5863
6010
|
currentHookNameInDev = 'useDebugValue';
|
|
5864
6011
|
warnInvalidHookAccess();
|
|
6012
|
+
mountHookTypesDev();
|
|
5865
6013
|
return mountDebugValue(value, formatterFn);
|
|
5866
6014
|
}
|
|
5867
6015
|
};
|
|
@@ -5874,31 +6022,37 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5874
6022
|
useCallback: function (callback, deps) {
|
|
5875
6023
|
currentHookNameInDev = 'useCallback';
|
|
5876
6024
|
warnInvalidHookAccess();
|
|
6025
|
+
updateHookTypesDev();
|
|
5877
6026
|
return updateCallback(callback, deps);
|
|
5878
6027
|
},
|
|
5879
6028
|
useContext: function (context, observedBits) {
|
|
5880
6029
|
currentHookNameInDev = 'useContext';
|
|
5881
6030
|
warnInvalidHookAccess();
|
|
5882
|
-
|
|
6031
|
+
updateHookTypesDev();
|
|
6032
|
+
return readContext(context, observedBits);
|
|
5883
6033
|
},
|
|
5884
6034
|
useEffect: function (create, deps) {
|
|
5885
6035
|
currentHookNameInDev = 'useEffect';
|
|
5886
6036
|
warnInvalidHookAccess();
|
|
6037
|
+
updateHookTypesDev();
|
|
5887
6038
|
return updateEffect(create, deps);
|
|
5888
6039
|
},
|
|
5889
6040
|
useImperativeHandle: function (ref, create, deps) {
|
|
5890
6041
|
currentHookNameInDev = 'useImperativeHandle';
|
|
5891
6042
|
warnInvalidHookAccess();
|
|
6043
|
+
updateHookTypesDev();
|
|
5892
6044
|
return updateImperativeHandle(ref, create, deps);
|
|
5893
6045
|
},
|
|
5894
6046
|
useLayoutEffect: function (create, deps) {
|
|
5895
6047
|
currentHookNameInDev = 'useLayoutEffect';
|
|
5896
6048
|
warnInvalidHookAccess();
|
|
6049
|
+
updateHookTypesDev();
|
|
5897
6050
|
return updateLayoutEffect(create, deps);
|
|
5898
6051
|
},
|
|
5899
6052
|
useMemo: function (create, deps) {
|
|
5900
6053
|
currentHookNameInDev = 'useMemo';
|
|
5901
6054
|
warnInvalidHookAccess();
|
|
6055
|
+
updateHookTypesDev();
|
|
5902
6056
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5903
6057
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
5904
6058
|
try {
|
|
@@ -5910,6 +6064,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5910
6064
|
useReducer: function (reducer, initialArg, init) {
|
|
5911
6065
|
currentHookNameInDev = 'useReducer';
|
|
5912
6066
|
warnInvalidHookAccess();
|
|
6067
|
+
updateHookTypesDev();
|
|
5913
6068
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5914
6069
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
5915
6070
|
try {
|
|
@@ -5921,11 +6076,13 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5921
6076
|
useRef: function (initialValue) {
|
|
5922
6077
|
currentHookNameInDev = 'useRef';
|
|
5923
6078
|
warnInvalidHookAccess();
|
|
6079
|
+
updateHookTypesDev();
|
|
5924
6080
|
return updateRef(initialValue);
|
|
5925
6081
|
},
|
|
5926
6082
|
useState: function (initialState) {
|
|
5927
6083
|
currentHookNameInDev = 'useState';
|
|
5928
6084
|
warnInvalidHookAccess();
|
|
6085
|
+
updateHookTypesDev();
|
|
5929
6086
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
5930
6087
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
5931
6088
|
try {
|
|
@@ -5937,6 +6094,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
|
|
|
5937
6094
|
useDebugValue: function (value, formatterFn) {
|
|
5938
6095
|
currentHookNameInDev = 'useDebugValue';
|
|
5939
6096
|
warnInvalidHookAccess();
|
|
6097
|
+
updateHookTypesDev();
|
|
5940
6098
|
return updateDebugValue(value, formatterFn);
|
|
5941
6099
|
}
|
|
5942
6100
|
};
|
|
@@ -12519,7 +12677,7 @@ function injectIntoDevTools(devToolsConfig) {
|
|
|
12519
12677
|
|
|
12520
12678
|
// TODO: this is special because it gets imported during build.
|
|
12521
12679
|
|
|
12522
|
-
var ReactVersion = '16.8.
|
|
12680
|
+
var ReactVersion = '16.8.4';
|
|
12523
12681
|
|
|
12524
12682
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
12525
12683
|
|