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.
@@ -1,4 +1,4 @@
1
- /** @license React v16.8.3
1
+ /** @license React v16.8.4
2
2
  * react-test-renderer.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1968,6 +1968,7 @@ function FiberNode(tag, pendingProps, key, mode) {
1968
1968
  this._debugSource = null;
1969
1969
  this._debugOwner = null;
1970
1970
  this._debugIsCurrentlyTiming = false;
1971
+ this._debugHookTypes = null;
1971
1972
  if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
1972
1973
  Object.preventExtensions(this);
1973
1974
  }
@@ -2035,6 +2036,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) {
2035
2036
  workInProgress._debugID = current._debugID;
2036
2037
  workInProgress._debugSource = current._debugSource;
2037
2038
  workInProgress._debugOwner = current._debugOwner;
2039
+ workInProgress._debugHookTypes = current._debugHookTypes;
2038
2040
  }
2039
2041
 
2040
2042
  workInProgress.alternate = current;
@@ -2302,6 +2304,7 @@ function assignFiberPropertiesInDEV(target, source) {
2302
2304
  target._debugSource = source._debugSource;
2303
2305
  target._debugOwner = source._debugOwner;
2304
2306
  target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
2307
+ target._debugHookTypes = source._debugHookTypes;
2305
2308
  return target;
2306
2309
  }
2307
2310
 
@@ -4978,7 +4981,6 @@ var currentlyRenderingFiber$1 = null;
4978
4981
  // current hook list is the list that belongs to the current fiber. The
4979
4982
  // work-in-progress hook list is a new list that will be added to the
4980
4983
  // work-in-progress fiber.
4981
- var firstCurrentHook = null;
4982
4984
  var currentHook = null;
4983
4985
  var nextCurrentHook = null;
4984
4986
  var firstWorkInProgressHook = null;
@@ -5008,39 +5010,67 @@ var RE_RENDER_LIMIT = 25;
5008
5010
  // In DEV, this is the name of the currently executing primitive hook
5009
5011
  var currentHookNameInDev = null;
5010
5012
 
5011
- function warnOnHookMismatchInDev() {
5013
+ // In DEV, this list ensures that hooks are called in the same order between renders.
5014
+ // The list stores the order of hooks used during the initial render (mount).
5015
+ // Subsequent renders (updates) reference this list.
5016
+ var hookTypesDev = null;
5017
+ var hookTypesUpdateIndexDev = -1;
5018
+
5019
+ function mountHookTypesDev() {
5020
+ {
5021
+ var hookName = currentHookNameInDev;
5022
+
5023
+ if (hookTypesDev === null) {
5024
+ hookTypesDev = [hookName];
5025
+ } else {
5026
+ hookTypesDev.push(hookName);
5027
+ }
5028
+ }
5029
+ }
5030
+
5031
+ function updateHookTypesDev() {
5032
+ {
5033
+ var hookName = currentHookNameInDev;
5034
+
5035
+ if (hookTypesDev !== null) {
5036
+ hookTypesUpdateIndexDev++;
5037
+ if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
5038
+ warnOnHookMismatchInDev(hookName);
5039
+ }
5040
+ }
5041
+ }
5042
+ }
5043
+
5044
+ function warnOnHookMismatchInDev(currentHookName) {
5012
5045
  {
5013
5046
  var componentName = getComponentName(currentlyRenderingFiber$1.type);
5014
5047
  if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
5015
5048
  didWarnAboutMismatchedHooksForComponent.add(componentName);
5016
5049
 
5017
- var secondColumnStart = 22;
5050
+ if (hookTypesDev !== null) {
5051
+ var table = '';
5018
5052
 
5019
- var table = '';
5020
- var prevHook = firstCurrentHook;
5021
- var nextHook = firstWorkInProgressHook;
5022
- var n = 1;
5023
- while (prevHook !== null && nextHook !== null) {
5024
- var oldHookName = prevHook._debugType;
5025
- var newHookName = nextHook._debugType;
5053
+ var secondColumnStart = 30;
5026
5054
 
5027
- var row = n + '. ' + oldHookName;
5055
+ for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
5056
+ var oldHookName = hookTypesDev[i];
5057
+ var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
5028
5058
 
5029
- // Extra space so second column lines up
5030
- // lol @ IE not supporting String#repeat
5031
- while (row.length < secondColumnStart) {
5032
- row += ' ';
5033
- }
5059
+ var row = i + 1 + '. ' + oldHookName;
5034
5060
 
5035
- row += newHookName + '\n';
5061
+ // Extra space so second column lines up
5062
+ // lol @ IE not supporting String#repeat
5063
+ while (row.length < secondColumnStart) {
5064
+ row += ' ';
5065
+ }
5036
5066
 
5037
- table += row;
5038
- prevHook = prevHook.next;
5039
- nextHook = nextHook.next;
5040
- n++;
5041
- }
5067
+ row += newHookName + '\n';
5068
+
5069
+ table += row;
5070
+ }
5042
5071
 
5043
- 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);
5072
+ 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);
5073
+ }
5044
5074
  }
5045
5075
  }
5046
5076
  }
@@ -5076,7 +5106,12 @@ function areHookInputsEqual(nextDeps, prevDeps) {
5076
5106
  function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
5077
5107
  renderExpirationTime = nextRenderExpirationTime;
5078
5108
  currentlyRenderingFiber$1 = workInProgress;
5079
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
5109
+ nextCurrentHook = current !== null ? current.memoizedState : null;
5110
+
5111
+ {
5112
+ hookTypesDev = current !== null ? current._debugHookTypes : null;
5113
+ hookTypesUpdateIndexDev = -1;
5114
+ }
5080
5115
 
5081
5116
  // The following should have already been reset
5082
5117
  // currentHook = null;
@@ -5090,8 +5125,26 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
5090
5125
  // numberOfReRenders = 0;
5091
5126
  // sideEffectTag = 0;
5092
5127
 
5128
+ // TODO Warn if no hooks are used at all during mount, then some are used during update.
5129
+ // Currently we will identify the update render as a mount because nextCurrentHook === null.
5130
+ // This is tricky because it's valid for certain types of components (e.g. React.lazy)
5131
+
5132
+ // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
5133
+ // Non-stateful hooks (e.g. context) don't get added to memoizedState,
5134
+ // so nextCurrentHook would be null during updates and mounts.
5093
5135
  {
5094
- ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
5136
+ if (nextCurrentHook !== null) {
5137
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
5138
+ } else if (hookTypesDev !== null) {
5139
+ // This dispatcher handles an edge case where a component is updating,
5140
+ // but no stateful hooks have been used.
5141
+ // We want to match the production code behavior (which will use HooksDispatcherOnMount),
5142
+ // but with the extra DEV validation to ensure hooks ordering hasn't changed.
5143
+ // This dispatcher does that.
5144
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
5145
+ } else {
5146
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
5147
+ }
5095
5148
  }
5096
5149
 
5097
5150
  var children = Component(props, refOrContext);
@@ -5102,13 +5155,18 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
5102
5155
  numberOfReRenders += 1;
5103
5156
 
5104
5157
  // Start over from the beginning of the list
5105
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
5158
+ nextCurrentHook = current !== null ? current.memoizedState : null;
5106
5159
  nextWorkInProgressHook = firstWorkInProgressHook;
5107
5160
 
5108
5161
  currentHook = null;
5109
5162
  workInProgressHook = null;
5110
5163
  componentUpdateQueue = null;
5111
5164
 
5165
+ {
5166
+ // Also validate hook order for cascading updates.
5167
+ hookTypesUpdateIndexDev = -1;
5168
+ }
5169
+
5112
5170
  ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
5113
5171
 
5114
5172
  children = Component(props, refOrContext);
@@ -5118,10 +5176,6 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
5118
5176
  numberOfReRenders = 0;
5119
5177
  }
5120
5178
 
5121
- {
5122
- currentHookNameInDev = null;
5123
- }
5124
-
5125
5179
  // We can assume the previous dispatcher is always this one, since we set it
5126
5180
  // at the beginning of the render phase and there's no re-entrancy.
5127
5181
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
@@ -5133,18 +5187,29 @@ function renderWithHooks(current, workInProgress, Component, props, refOrContext
5133
5187
  renderedWork.updateQueue = componentUpdateQueue;
5134
5188
  renderedWork.effectTag |= sideEffectTag;
5135
5189
 
5190
+ {
5191
+ renderedWork._debugHookTypes = hookTypesDev;
5192
+ }
5193
+
5194
+ // This check uses currentHook so that it works the same in DEV and prod bundles.
5195
+ // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
5136
5196
  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
5137
5197
 
5138
5198
  renderExpirationTime = NoWork;
5139
5199
  currentlyRenderingFiber$1 = null;
5140
5200
 
5141
- firstCurrentHook = null;
5142
5201
  currentHook = null;
5143
5202
  nextCurrentHook = null;
5144
5203
  firstWorkInProgressHook = null;
5145
5204
  workInProgressHook = null;
5146
5205
  nextWorkInProgressHook = null;
5147
5206
 
5207
+ {
5208
+ currentHookNameInDev = null;
5209
+ hookTypesDev = null;
5210
+ hookTypesUpdateIndexDev = -1;
5211
+ }
5212
+
5148
5213
  remainingExpirationTime = NoWork;
5149
5214
  componentUpdateQueue = null;
5150
5215
  sideEffectTag = 0;
@@ -5178,21 +5243,23 @@ function resetHooks() {
5178
5243
  renderExpirationTime = NoWork;
5179
5244
  currentlyRenderingFiber$1 = null;
5180
5245
 
5181
- firstCurrentHook = null;
5182
5246
  currentHook = null;
5183
5247
  nextCurrentHook = null;
5184
5248
  firstWorkInProgressHook = null;
5185
5249
  workInProgressHook = null;
5186
5250
  nextWorkInProgressHook = null;
5187
5251
 
5188
- remainingExpirationTime = NoWork;
5189
- componentUpdateQueue = null;
5190
- sideEffectTag = 0;
5191
-
5192
5252
  {
5253
+ hookTypesDev = null;
5254
+ hookTypesUpdateIndexDev = -1;
5255
+
5193
5256
  currentHookNameInDev = null;
5194
5257
  }
5195
5258
 
5259
+ remainingExpirationTime = NoWork;
5260
+ componentUpdateQueue = null;
5261
+ sideEffectTag = 0;
5262
+
5196
5263
  didScheduleRenderPhaseUpdate = false;
5197
5264
  renderPhaseUpdates = null;
5198
5265
  numberOfReRenders = 0;
@@ -5209,9 +5276,6 @@ function mountWorkInProgressHook() {
5209
5276
  next: null
5210
5277
  };
5211
5278
 
5212
- {
5213
- hook._debugType = currentHookNameInDev;
5214
- }
5215
5279
  if (workInProgressHook === null) {
5216
5280
  // This is the first hook in the list
5217
5281
  firstWorkInProgressHook = workInProgressHook = hook;
@@ -5258,13 +5322,6 @@ function updateWorkInProgressHook() {
5258
5322
  workInProgressHook = workInProgressHook.next = newHook;
5259
5323
  }
5260
5324
  nextCurrentHook = currentHook.next;
5261
-
5262
- {
5263
- newHook._debugType = currentHookNameInDev;
5264
- if (currentHookNameInDev !== currentHook._debugType) {
5265
- warnOnHookMismatchInDev();
5266
- }
5267
- }
5268
5325
  }
5269
5326
  return workInProgressHook;
5270
5327
  }
@@ -5279,20 +5336,6 @@ function basicStateReducer(state, action) {
5279
5336
  return typeof action === 'function' ? action(state) : action;
5280
5337
  }
5281
5338
 
5282
- function mountContext(context, observedBits) {
5283
- {
5284
- mountWorkInProgressHook();
5285
- }
5286
- return readContext(context, observedBits);
5287
- }
5288
-
5289
- function updateContext(context, observedBits) {
5290
- {
5291
- updateWorkInProgressHook();
5292
- }
5293
- return readContext(context, observedBits);
5294
- }
5295
-
5296
5339
  function mountReducer(reducer, initialArg, init) {
5297
5340
  var hook = mountWorkInProgressHook();
5298
5341
  var initialState = void 0;
@@ -5785,6 +5828,7 @@ var ContextOnlyDispatcher = {
5785
5828
  };
5786
5829
 
5787
5830
  var HooksDispatcherOnMountInDEV = null;
5831
+ var HooksDispatcherOnMountWithHookTypesInDEV = null;
5788
5832
  var HooksDispatcherOnUpdateInDEV = null;
5789
5833
  var InvalidNestedHooksDispatcherOnMountInDEV = null;
5790
5834
  var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
@@ -5804,26 +5848,106 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5804
5848
  },
5805
5849
  useCallback: function (callback, deps) {
5806
5850
  currentHookNameInDev = 'useCallback';
5851
+ mountHookTypesDev();
5852
+ return mountCallback(callback, deps);
5853
+ },
5854
+ useContext: function (context, observedBits) {
5855
+ currentHookNameInDev = 'useContext';
5856
+ mountHookTypesDev();
5857
+ return readContext(context, observedBits);
5858
+ },
5859
+ useEffect: function (create, deps) {
5860
+ currentHookNameInDev = 'useEffect';
5861
+ mountHookTypesDev();
5862
+ return mountEffect(create, deps);
5863
+ },
5864
+ useImperativeHandle: function (ref, create, deps) {
5865
+ currentHookNameInDev = 'useImperativeHandle';
5866
+ mountHookTypesDev();
5867
+ return mountImperativeHandle(ref, create, deps);
5868
+ },
5869
+ useLayoutEffect: function (create, deps) {
5870
+ currentHookNameInDev = 'useLayoutEffect';
5871
+ mountHookTypesDev();
5872
+ return mountLayoutEffect(create, deps);
5873
+ },
5874
+ useMemo: function (create, deps) {
5875
+ currentHookNameInDev = 'useMemo';
5876
+ mountHookTypesDev();
5877
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
5878
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5879
+ try {
5880
+ return mountMemo(create, deps);
5881
+ } finally {
5882
+ ReactCurrentDispatcher$1.current = prevDispatcher;
5883
+ }
5884
+ },
5885
+ useReducer: function (reducer, initialArg, init) {
5886
+ currentHookNameInDev = 'useReducer';
5887
+ mountHookTypesDev();
5888
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
5889
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5890
+ try {
5891
+ return mountReducer(reducer, initialArg, init);
5892
+ } finally {
5893
+ ReactCurrentDispatcher$1.current = prevDispatcher;
5894
+ }
5895
+ },
5896
+ useRef: function (initialValue) {
5897
+ currentHookNameInDev = 'useRef';
5898
+ mountHookTypesDev();
5899
+ return mountRef(initialValue);
5900
+ },
5901
+ useState: function (initialState) {
5902
+ currentHookNameInDev = 'useState';
5903
+ mountHookTypesDev();
5904
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
5905
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5906
+ try {
5907
+ return mountState(initialState);
5908
+ } finally {
5909
+ ReactCurrentDispatcher$1.current = prevDispatcher;
5910
+ }
5911
+ },
5912
+ useDebugValue: function (value, formatterFn) {
5913
+ currentHookNameInDev = 'useDebugValue';
5914
+ mountHookTypesDev();
5915
+ return mountDebugValue(value, formatterFn);
5916
+ }
5917
+ };
5918
+
5919
+ HooksDispatcherOnMountWithHookTypesInDEV = {
5920
+ readContext: function (context, observedBits) {
5921
+ return readContext(context, observedBits);
5922
+ },
5923
+ useCallback: function (callback, deps) {
5924
+ currentHookNameInDev = 'useCallback';
5925
+ updateHookTypesDev();
5807
5926
  return mountCallback(callback, deps);
5808
5927
  },
5809
5928
  useContext: function (context, observedBits) {
5810
5929
  currentHookNameInDev = 'useContext';
5811
- return mountContext(context, observedBits);
5930
+ updateHookTypesDev();
5931
+ return readContext(context, observedBits);
5812
5932
  },
5813
5933
  useEffect: function (create, deps) {
5814
5934
  currentHookNameInDev = 'useEffect';
5935
+ updateHookTypesDev();
5815
5936
  return mountEffect(create, deps);
5816
5937
  },
5817
5938
  useImperativeHandle: function (ref, create, deps) {
5818
5939
  currentHookNameInDev = 'useImperativeHandle';
5940
+ updateHookTypesDev();
5819
5941
  return mountImperativeHandle(ref, create, deps);
5820
5942
  },
5821
5943
  useLayoutEffect: function (create, deps) {
5822
5944
  currentHookNameInDev = 'useLayoutEffect';
5945
+ updateHookTypesDev();
5823
5946
  return mountLayoutEffect(create, deps);
5824
5947
  },
5825
5948
  useMemo: function (create, deps) {
5826
5949
  currentHookNameInDev = 'useMemo';
5950
+ updateHookTypesDev();
5827
5951
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5828
5952
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5829
5953
  try {
@@ -5834,6 +5958,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5834
5958
  },
5835
5959
  useReducer: function (reducer, initialArg, init) {
5836
5960
  currentHookNameInDev = 'useReducer';
5961
+ updateHookTypesDev();
5837
5962
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5838
5963
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5839
5964
  try {
@@ -5844,10 +5969,12 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5844
5969
  },
5845
5970
  useRef: function (initialValue) {
5846
5971
  currentHookNameInDev = 'useRef';
5972
+ updateHookTypesDev();
5847
5973
  return mountRef(initialValue);
5848
5974
  },
5849
5975
  useState: function (initialState) {
5850
5976
  currentHookNameInDev = 'useState';
5977
+ updateHookTypesDev();
5851
5978
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5852
5979
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5853
5980
  try {
@@ -5858,6 +5985,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5858
5985
  },
5859
5986
  useDebugValue: function (value, formatterFn) {
5860
5987
  currentHookNameInDev = 'useDebugValue';
5988
+ updateHookTypesDev();
5861
5989
  return mountDebugValue(value, formatterFn);
5862
5990
  }
5863
5991
  };
@@ -5868,26 +5996,32 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5868
5996
  },
5869
5997
  useCallback: function (callback, deps) {
5870
5998
  currentHookNameInDev = 'useCallback';
5999
+ updateHookTypesDev();
5871
6000
  return updateCallback(callback, deps);
5872
6001
  },
5873
6002
  useContext: function (context, observedBits) {
5874
6003
  currentHookNameInDev = 'useContext';
5875
- return updateContext(context, observedBits);
6004
+ updateHookTypesDev();
6005
+ return readContext(context, observedBits);
5876
6006
  },
5877
6007
  useEffect: function (create, deps) {
5878
6008
  currentHookNameInDev = 'useEffect';
6009
+ updateHookTypesDev();
5879
6010
  return updateEffect(create, deps);
5880
6011
  },
5881
6012
  useImperativeHandle: function (ref, create, deps) {
5882
6013
  currentHookNameInDev = 'useImperativeHandle';
6014
+ updateHookTypesDev();
5883
6015
  return updateImperativeHandle(ref, create, deps);
5884
6016
  },
5885
6017
  useLayoutEffect: function (create, deps) {
5886
6018
  currentHookNameInDev = 'useLayoutEffect';
6019
+ updateHookTypesDev();
5887
6020
  return updateLayoutEffect(create, deps);
5888
6021
  },
5889
6022
  useMemo: function (create, deps) {
5890
6023
  currentHookNameInDev = 'useMemo';
6024
+ updateHookTypesDev();
5891
6025
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5892
6026
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
5893
6027
  try {
@@ -5898,6 +6032,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5898
6032
  },
5899
6033
  useReducer: function (reducer, initialArg, init) {
5900
6034
  currentHookNameInDev = 'useReducer';
6035
+ updateHookTypesDev();
5901
6036
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5902
6037
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
5903
6038
  try {
@@ -5908,10 +6043,12 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5908
6043
  },
5909
6044
  useRef: function (initialValue) {
5910
6045
  currentHookNameInDev = 'useRef';
6046
+ updateHookTypesDev();
5911
6047
  return updateRef(initialValue);
5912
6048
  },
5913
6049
  useState: function (initialState) {
5914
6050
  currentHookNameInDev = 'useState';
6051
+ updateHookTypesDev();
5915
6052
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5916
6053
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
5917
6054
  try {
@@ -5922,6 +6059,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5922
6059
  },
5923
6060
  useDebugValue: function (value, formatterFn) {
5924
6061
  currentHookNameInDev = 'useDebugValue';
6062
+ updateHookTypesDev();
5925
6063
  return updateDebugValue(value, formatterFn);
5926
6064
  }
5927
6065
  };
@@ -5934,31 +6072,37 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5934
6072
  useCallback: function (callback, deps) {
5935
6073
  currentHookNameInDev = 'useCallback';
5936
6074
  warnInvalidHookAccess();
6075
+ mountHookTypesDev();
5937
6076
  return mountCallback(callback, deps);
5938
6077
  },
5939
6078
  useContext: function (context, observedBits) {
5940
6079
  currentHookNameInDev = 'useContext';
5941
6080
  warnInvalidHookAccess();
5942
- return mountContext(context, observedBits);
6081
+ mountHookTypesDev();
6082
+ return readContext(context, observedBits);
5943
6083
  },
5944
6084
  useEffect: function (create, deps) {
5945
6085
  currentHookNameInDev = 'useEffect';
5946
6086
  warnInvalidHookAccess();
6087
+ mountHookTypesDev();
5947
6088
  return mountEffect(create, deps);
5948
6089
  },
5949
6090
  useImperativeHandle: function (ref, create, deps) {
5950
6091
  currentHookNameInDev = 'useImperativeHandle';
5951
6092
  warnInvalidHookAccess();
6093
+ mountHookTypesDev();
5952
6094
  return mountImperativeHandle(ref, create, deps);
5953
6095
  },
5954
6096
  useLayoutEffect: function (create, deps) {
5955
6097
  currentHookNameInDev = 'useLayoutEffect';
5956
6098
  warnInvalidHookAccess();
6099
+ mountHookTypesDev();
5957
6100
  return mountLayoutEffect(create, deps);
5958
6101
  },
5959
6102
  useMemo: function (create, deps) {
5960
6103
  currentHookNameInDev = 'useMemo';
5961
6104
  warnInvalidHookAccess();
6105
+ mountHookTypesDev();
5962
6106
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5963
6107
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5964
6108
  try {
@@ -5970,6 +6114,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5970
6114
  useReducer: function (reducer, initialArg, init) {
5971
6115
  currentHookNameInDev = 'useReducer';
5972
6116
  warnInvalidHookAccess();
6117
+ mountHookTypesDev();
5973
6118
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5974
6119
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5975
6120
  try {
@@ -5981,11 +6126,13 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5981
6126
  useRef: function (initialValue) {
5982
6127
  currentHookNameInDev = 'useRef';
5983
6128
  warnInvalidHookAccess();
6129
+ mountHookTypesDev();
5984
6130
  return mountRef(initialValue);
5985
6131
  },
5986
6132
  useState: function (initialState) {
5987
6133
  currentHookNameInDev = 'useState';
5988
6134
  warnInvalidHookAccess();
6135
+ mountHookTypesDev();
5989
6136
  var prevDispatcher = ReactCurrentDispatcher$1.current;
5990
6137
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
5991
6138
  try {
@@ -5997,6 +6144,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
5997
6144
  useDebugValue: function (value, formatterFn) {
5998
6145
  currentHookNameInDev = 'useDebugValue';
5999
6146
  warnInvalidHookAccess();
6147
+ mountHookTypesDev();
6000
6148
  return mountDebugValue(value, formatterFn);
6001
6149
  }
6002
6150
  };
@@ -6009,31 +6157,37 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
6009
6157
  useCallback: function (callback, deps) {
6010
6158
  currentHookNameInDev = 'useCallback';
6011
6159
  warnInvalidHookAccess();
6160
+ updateHookTypesDev();
6012
6161
  return updateCallback(callback, deps);
6013
6162
  },
6014
6163
  useContext: function (context, observedBits) {
6015
6164
  currentHookNameInDev = 'useContext';
6016
6165
  warnInvalidHookAccess();
6017
- return updateContext(context, observedBits);
6166
+ updateHookTypesDev();
6167
+ return readContext(context, observedBits);
6018
6168
  },
6019
6169
  useEffect: function (create, deps) {
6020
6170
  currentHookNameInDev = 'useEffect';
6021
6171
  warnInvalidHookAccess();
6172
+ updateHookTypesDev();
6022
6173
  return updateEffect(create, deps);
6023
6174
  },
6024
6175
  useImperativeHandle: function (ref, create, deps) {
6025
6176
  currentHookNameInDev = 'useImperativeHandle';
6026
6177
  warnInvalidHookAccess();
6178
+ updateHookTypesDev();
6027
6179
  return updateImperativeHandle(ref, create, deps);
6028
6180
  },
6029
6181
  useLayoutEffect: function (create, deps) {
6030
6182
  currentHookNameInDev = 'useLayoutEffect';
6031
6183
  warnInvalidHookAccess();
6184
+ updateHookTypesDev();
6032
6185
  return updateLayoutEffect(create, deps);
6033
6186
  },
6034
6187
  useMemo: function (create, deps) {
6035
6188
  currentHookNameInDev = 'useMemo';
6036
6189
  warnInvalidHookAccess();
6190
+ updateHookTypesDev();
6037
6191
  var prevDispatcher = ReactCurrentDispatcher$1.current;
6038
6192
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
6039
6193
  try {
@@ -6045,6 +6199,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
6045
6199
  useReducer: function (reducer, initialArg, init) {
6046
6200
  currentHookNameInDev = 'useReducer';
6047
6201
  warnInvalidHookAccess();
6202
+ updateHookTypesDev();
6048
6203
  var prevDispatcher = ReactCurrentDispatcher$1.current;
6049
6204
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
6050
6205
  try {
@@ -6056,11 +6211,13 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
6056
6211
  useRef: function (initialValue) {
6057
6212
  currentHookNameInDev = 'useRef';
6058
6213
  warnInvalidHookAccess();
6214
+ updateHookTypesDev();
6059
6215
  return updateRef(initialValue);
6060
6216
  },
6061
6217
  useState: function (initialState) {
6062
6218
  currentHookNameInDev = 'useState';
6063
6219
  warnInvalidHookAccess();
6220
+ updateHookTypesDev();
6064
6221
  var prevDispatcher = ReactCurrentDispatcher$1.current;
6065
6222
  ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
6066
6223
  try {
@@ -6072,6 +6229,7 @@ var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
6072
6229
  useDebugValue: function (value, formatterFn) {
6073
6230
  currentHookNameInDev = 'useDebugValue';
6074
6231
  warnInvalidHookAccess();
6232
+ updateHookTypesDev();
6075
6233
  return updateDebugValue(value, formatterFn);
6076
6234
  }
6077
6235
  };
@@ -12654,7 +12812,7 @@ function injectIntoDevTools(devToolsConfig) {
12654
12812
 
12655
12813
  // TODO: this is special because it gets imported during build.
12656
12814
 
12657
- var ReactVersion = '16.8.3';
12815
+ var ReactVersion = '16.8.4';
12658
12816
 
12659
12817
  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; }; }();
12660
12818
 
@@ -1,4 +1,4 @@
1
- /** @license React v16.8.3
1
+ /** @license React v16.8.4
2
2
  * react-test-renderer.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -133,4 +133,4 @@ b){var c=oe,d=!1;"object"===typeof b&&null!==b&&("function"===typeof b.createNod
133
133
  var a=null;if(e.children&&e.children.length)for(var b=0;b<e.children.length;b++){var c=Tb(e.children[b]);null!==c&&(null===a?a=[c]:a.push(c))}return a},toTree:function(){return null==f||null==f.current?null:Ub(f.current)},update:function(a){null!=f&&null!=f.current&&Sb(a,f,null,null)},unmount:function(){null!=f&&null!=f.current&&(Sb(null,f,null,null),f=e=null)},getInstance:function(){if(null==f||null==f.current)return null;a:{var a=f.current;if(a.child)switch(a.child.tag){case 5:a=qb(a.child.stateNode);
134
134
  break a;default:a=a.child.stateNode}else a=null}return a},unstable_flushAll:te,unstable_flushSync:function(a){ac();a:{H?m("187"):void 0;var b=na;na=!0;try{var c=hf(a,void 0);break a}finally{na=b,La(1073741823,!1)}c=void 0}return c},unstable_flushNumberOfYields:ue,unstable_clearYields:ac};Object.defineProperty(a,"root",{configurable:!0,enumerable:!0,get:function(){if(null===f)throw Error("Can't access .root on unmounted test renderer");var a=Pc(f.current);if(0===a.length)throw Error("Can't access .root on unmounted test renderer");
135
135
  return 1===a.length?a[0]:Rc(f.current)}});return a},unstable_yield:function(a){L.push(a)},unstable_clearYields:ac,unstable_batchedUpdates:le,unstable_setNowImplementation:function(a){Lb=a},act:function(a){le(a);Sb(null,qf,null,null);return{then:function(){}}}},qf=function(a,b,c){return hd(a,b,c)}({children:[],createNodeMock:oe,tag:"CONTAINER"},!0,!1),Tc=new WeakMap;(function(a){var b=a.findFiberByHostInstance;return xe(ea({},a,{overrideProps:null,currentDispatcherRef:xa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=
136
- se(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.8.3",rendererPackageName:"react-test-renderer"});var qe={default:pe},re=qe&&pe||qe;return re.default||re});
136
+ se(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.8.4",rendererPackageName:"react-test-renderer"});var qe={default:pe},re=qe&&pe||qe;return re.default||re});