Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: react-dom @ 16.8.3 .. 16.8.4

build-info.json

@@ -1,8 +1,8 @@
{
- "branch": "pull/14902",
- "buildNumber": "13558",
- "checksum": "9da4ab1",
- "commit": "29b7b775f",
+ "branch": "16.8.4",
+ "buildNumber": "13714",
+ "checksum": "94d3bf9",
+ "commit": "741aa17a3",
"environment": "ci",
- "reactVersion": "16.8.2-canary-29b7b775f"
+ "reactVersion": "16.8.3-canary-741aa17a3"
}

cjs/react-dom.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -10001,6 +10001,7 @@
this._debugSource = null;
this._debugOwner = null;
this._debugIsCurrentlyTiming = false;
+ this._debugHookTypes = null;
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
Object.preventExtensions(this);
}
@@ -10068,6 +10069,7 @@
workInProgress._debugID = current._debugID;
workInProgress._debugSource = current._debugSource;
workInProgress._debugOwner = current._debugOwner;
+ workInProgress._debugHookTypes = current._debugHookTypes;
}
workInProgress.alternate = current;
@@ -10335,6 +10337,7 @@
target._debugSource = source._debugSource;
target._debugOwner = source._debugOwner;
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
+ target._debugHookTypes = source._debugHookTypes;
return target;
}
@@ -12720,7 +12723,6 @@
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.
-var firstCurrentHook = null;
var currentHook = null;
var nextCurrentHook = null;
var firstWorkInProgressHook = null;
@@ -12750,23 +12752,53 @@
// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = null;
-function warnOnHookMismatchInDev() {
+// In DEV, this list ensures that hooks are called in the same order between renders.
+// The list stores the order of hooks used during the initial render (mount).
+// Subsequent renders (updates) reference this list.
+var hookTypesDev = null;
+var hookTypesUpdateIndexDev = -1;
+
+function mountHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev === null) {
+ hookTypesDev = [hookName];
+ } else {
+ hookTypesDev.push(hookName);
+ }
+ }
+}
+
+function updateHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev !== null) {
+ hookTypesUpdateIndexDev++;
+ if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
+ warnOnHookMismatchInDev(hookName);
+ }
+ }
+ }
+}
+
+function warnOnHookMismatchInDev(currentHookName) {
{
var componentName = getComponentName(currentlyRenderingFiber$1.type);
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
didWarnAboutMismatchedHooksForComponent.add(componentName);
- var secondColumnStart = 22;
-
+ if (hookTypesDev !== null) {
var table = '';
- var prevHook = firstCurrentHook;
- var nextHook = firstWorkInProgressHook;
- var n = 1;
- while (prevHook !== null && nextHook !== null) {
- var oldHookName = prevHook._debugType;
- var newHookName = nextHook._debugType;
- var row = n + '. ' + oldHookName;
+ var secondColumnStart = 30;
+
+ for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
+ var oldHookName = hookTypesDev[i];
+ var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
+
+ var row = i + 1 + '. ' + oldHookName;
// Extra space so second column lines up
// lol @ IE not supporting String#repeat
@@ -12777,12 +12809,10 @@
row += newHookName + '\n';
table += row;
- prevHook = prevHook.next;
- nextHook = nextHook.next;
- n++;
}
- 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);
+ 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);
+ }
}
}
}
@@ -12818,7 +12848,12 @@
function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
renderExpirationTime = nextRenderExpirationTime;
currentlyRenderingFiber$1 = workInProgress;
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
+
+ {
+ hookTypesDev = current !== null ? current._debugHookTypes : null;
+ hookTypesUpdateIndexDev = -1;
+ }
// The following should have already been reset
// currentHook = null;
@@ -12832,8 +12867,26 @@
// numberOfReRenders = 0;
// sideEffectTag = 0;
+ // TODO Warn if no hooks are used at all during mount, then some are used during update.
+ // Currently we will identify the update render as a mount because nextCurrentHook === null.
+ // This is tricky because it's valid for certain types of components (e.g. React.lazy)
+
+ // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
+ // Non-stateful hooks (e.g. context) don't get added to memoizedState,
+ // so nextCurrentHook would be null during updates and mounts.
{
- ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
+ if (nextCurrentHook !== null) {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
+ } else if (hookTypesDev !== null) {
+ // This dispatcher handles an edge case where a component is updating,
+ // but no stateful hooks have been used.
+ // We want to match the production code behavior (which will use HooksDispatcherOnMount),
+ // but with the extra DEV validation to ensure hooks ordering hasn't changed.
+ // This dispatcher does that.
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
+ } else {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
+ }
}
var children = Component(props, refOrContext);
@@ -12844,13 +12897,18 @@
numberOfReRenders += 1;
// Start over from the beginning of the list
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
nextWorkInProgressHook = firstWorkInProgressHook;
currentHook = null;
workInProgressHook = null;
componentUpdateQueue = null;
+ {
+ // Also validate hook order for cascading updates.
+ hookTypesUpdateIndexDev = -1;
+ }
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
children = Component(props, refOrContext);
@@ -12860,10 +12918,6 @@
numberOfReRenders = 0;
}
- {
- currentHookNameInDev = null;
- }
-
// We can assume the previous dispatcher is always this one, since we set it
// at the beginning of the render phase and there's no re-entrancy.
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
@@ -12875,18 +12929,29 @@
renderedWork.updateQueue = componentUpdateQueue;
renderedWork.effectTag |= sideEffectTag;
+ {
+ renderedWork._debugHookTypes = hookTypesDev;
+ }
+
+ // This check uses currentHook so that it works the same in DEV and prod bundles.
+ // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
+ {
+ currentHookNameInDev = null;
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+ }
+
remainingExpirationTime = NoWork;
componentUpdateQueue = null;
sideEffectTag = 0;
@@ -12920,21 +12985,23 @@
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
- remainingExpirationTime = NoWork;
- componentUpdateQueue = null;
- sideEffectTag = 0;
-
{
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+
currentHookNameInDev = null;
}
+ remainingExpirationTime = NoWork;
+ componentUpdateQueue = null;
+ sideEffectTag = 0;
+
didScheduleRenderPhaseUpdate = false;
renderPhaseUpdates = null;
numberOfReRenders = 0;
@@ -12951,9 +13018,6 @@
next: null
};
- {
- hook._debugType = currentHookNameInDev;
- }
if (workInProgressHook === null) {
// This is the first hook in the list
firstWorkInProgressHook = workInProgressHook = hook;
@@ -13000,13 +13064,6 @@
workInProgressHook = workInProgressHook.next = newHook;
}
nextCurrentHook = currentHook.next;
-
- {
- newHook._debugType = currentHookNameInDev;
- if (currentHookNameInDev !== currentHook._debugType) {
- warnOnHookMismatchInDev();
- }
- }
}
return workInProgressHook;
}
@@ -13021,20 +13078,6 @@
return typeof action === 'function' ? action(state) : action;
}
-function mountContext(context, observedBits) {
- {
- mountWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
-function updateContext(context, observedBits) {
- {
- updateWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
function mountReducer(reducer, initialArg, init) {
var hook = mountWorkInProgressHook();
var initialState = void 0;
@@ -13527,6 +13570,7 @@
};
var HooksDispatcherOnMountInDEV = null;
+var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
@@ -13546,26 +13590,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13576,6 +13626,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13586,10 +13637,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13600,6 +13653,81 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ mountHookTypesDev();
+ return mountDebugValue(value, formatterFn);
+ }
+ };
+
+ HooksDispatcherOnMountWithHookTypesInDEV = {
+ readContext: function (context, observedBits) {
+ return readContext(context, observedBits);
+ },
+ useCallback: function (callback, deps) {
+ currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
+ return mountCallback(callback, deps);
+ },
+ useContext: function (context, observedBits) {
+ currentHookNameInDev = 'useContext';
+ updateHookTypesDev();
+ return readContext(context, observedBits);
+ },
+ useEffect: function (create, deps) {
+ currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
+ return mountEffect(create, deps);
+ },
+ useImperativeHandle: function (ref, create, deps) {
+ currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
+ return mountImperativeHandle(ref, create, deps);
+ },
+ useLayoutEffect: function (create, deps) {
+ currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
+ return mountLayoutEffect(create, deps);
+ },
+ useMemo: function (create, deps) {
+ currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountMemo(create, deps);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useReducer: function (reducer, initialArg, init) {
+ currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountReducer(reducer, initialArg, init);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useRef: function (initialValue) {
+ currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
+ return mountRef(initialValue);
+ },
+ useState: function (initialState) {
+ currentHookNameInDev = 'useState';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountState(initialState);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useDebugValue: function (value, formatterFn) {
+ currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13610,26 +13738,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13640,6 +13774,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13650,10 +13785,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13664,6 +13801,7 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -13676,31 +13814,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13712,6 +13856,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13723,11 +13868,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13739,6 +13886,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13751,31 +13899,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13787,6 +13941,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13798,11 +13953,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13814,6 +13971,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -20548,7 +20706,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
// TODO: This type is shared between the reconciler and ReactDOM, but will
// eventually be lifted out to the renderer.

cjs/react-dom.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -266,4 +266,4 @@
var Vi={createPortal:Ti,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?x("188"):x("268",Object.keys(a)));a=hd(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){Qi(b)?void 0:x("200");return Si(null,a,b,!0,c)},render:function(a,b,c){Qi(b)?void 0:x("200");return Si(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){Qi(c)?void 0:x("200");null==a||void 0===a._reactInternalFiber?
x("38"):void 0;return Si(a,b,c,!1,d)},unmountComponentAtNode:function(a){Qi(a)?void 0:x("40");return a._reactRootContainer?(Hi(function(){Si(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return Ti.apply(void 0,arguments)},unstable_batchedUpdates:Gi,unstable_interactiveUpdates:Ii,flushSync:function(a,b){W?x("187"):void 0;var c=X;X=!0;try{return ki(a,b)}finally{X=c,Yh(1073741823,!1)}},unstable_createRoot:Ui,unstable_flushControlled:function(a){var b=
X;X=!0;try{ki(a)}finally{(X=b)||W||Yh(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,Ba.injectEventPluginsByName,pa,Qa,function(a){ya(a,Pa)},Eb,Fb,Dd,Da]}};function Ui(a,b){Qi(a)?void 0:x("299","unstable_createRoot");return new Pi(a,!0,null!=b&&!0===b.hydrate)}
-(function(a){var b=a.findFiberByHostInstance;return Te(n({},a,{overrideProps:null,currentDispatcherRef:Tb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=hd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var Wi={default:Vi},Xi=Wi&&Vi||Wi;module.exports=Xi.default||Xi;
+(function(a){var b=a.findFiberByHostInstance;return Te(n({},a,{overrideProps:null,currentDispatcherRef:Tb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=hd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var Wi={default:Vi},Xi=Wi&&Vi||Wi;module.exports=Xi.default||Xi;

cjs/react-dom.profiling.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom.profiling.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -274,4 +274,4 @@
var ej={createPortal:cj,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?x("188"):x("268",Object.keys(a)));a=kd(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){$i(b)?void 0:x("200");return bj(null,a,b,!0,c)},render:function(a,b,c){$i(b)?void 0:x("200");return bj(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){$i(c)?void 0:x("200");null==a||void 0===a._reactInternalFiber?
x("38"):void 0;return bj(a,b,c,!1,d)},unmountComponentAtNode:function(a){$i(a)?void 0:x("40");return a._reactRootContainer?(Ri(function(){bj(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return cj.apply(void 0,arguments)},unstable_batchedUpdates:Qi,unstable_interactiveUpdates:Si,flushSync:function(a,b){V?x("187"):void 0;var c=W;W=!0;try{return wi(a,b)}finally{W=c,ii(1073741823,!1)}},unstable_createRoot:dj,unstable_flushControlled:function(a){var b=
W;W=!0;try{wi(a)}finally{(W=b)||V||ii(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,Ba.injectEventPluginsByName,pa,Ra,function(a){ya(a,Qa)},Gb,Hb,Gd,Da]}};function dj(a,b){$i(a)?void 0:x("299","unstable_createRoot");return new Zi(a,!0,null!=b&&!0===b.hydrate)}
-(function(a){var b=a.findFiberByHostInstance;return Xe(n({},a,{overrideProps:null,currentDispatcherRef:Wb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=kd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var fj={default:ej},gj=fj&&ej||fj;module.exports=gj.default||gj;
+(function(a){var b=a.findFiberByHostInstance;return Xe(n({},a,{overrideProps:null,currentDispatcherRef:Wb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=kd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var fj={default:ej},gj=fj&&ej||fj;module.exports=gj.default||gj;

cjs/react-dom-server.browser.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-server.browser.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -66,7 +66,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
/**
* Similar to invariant but only logs a warning if the condition is not met.

cjs/react-dom-server.browser.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-server.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -48,4 +48,4 @@
m.indexOf("-"))m="string"===typeof u.is;else switch(m){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":m=!1;break b;default:m=!0}if(m)Pa.hasOwnProperty(y)||(n=y,n=qa(n)&&null!=l?n+"="+('"'+M(l)+'"'):"");else{m=y;n=l;l=J.hasOwnProperty(m)?J[m]:null;if(u="style"!==m)u=null!==l?0===l.type:!(2<m.length)||"o"!==m[0]&&"O"!==m[0]||"n"!==m[1]&&"N"!==m[1]?!1:!0;u||sa(m,n,l,!1)?n="":null!==
l?(m=l.attributeName,l=l.type,n=3===l||4===l&&!0===n?m+'=""':m+"="+('"'+M(n)+'"')):n=qa(m)?m+"="+('"'+M(n)+'"'):""}n&&(B+=" "+n)}}g||D&&(B+=' data-reactroot=""');var y=B;h="";Da.hasOwnProperty(b)?y+="/>":(y+=">",h="</"+a.type+">");a:{g=e.dangerouslySetInnerHTML;if(null!=g){if(null!=g.__html){g=g.__html;break a}}else if(g=e.children,"string"===typeof g||"number"===typeof g){g=M(g);break a}g=null}null!=g?(e=[],Ja[b]&&"\n"===g.charAt(0)&&(y+="\n"),y+=g):e=Z(e.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===
c?Ca(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:e,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return y};return a}(),Ta={renderToString:function(a){a=new Sa(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Sa(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){r("207")},renderToStaticNodeStream:function(){r("208")},
-version:"16.8.3"},Ua={default:Ta},Va=Ua&&Ta||Ua;module.exports=Va.default||Va;
+version:"16.8.4"},Ua={default:Ta},Va=Ua&&Ta||Ua;module.exports=Va.default||Va;

cjs/react-dom-server.node.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-server.node.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -22,7 +22,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
/**
* Use invariant() to assert state which your program assumes to be true.

cjs/react-dom-server.node.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-server.node.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -50,4 +50,4 @@
c?Da(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:e,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return y};return a}();
function Ua(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}
var Va=function(a){function b(d,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var f=a.call(this,{});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");f=!f||"object"!==typeof f&&"function"!==typeof f?this:f;f.partialRenderer=new Ta(d,c);return f}Ua(b,a);b.prototype._destroy=function(a,b){this.partialRenderer.destroy();b(a)};b.prototype._read=function(a){try{this.push(this.partialRenderer.read(a))}catch(c){this.destroy(c)}};
-return b}(aa.Readable),Wa={renderToString:function(a){a=new Ta(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Ta(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(a){return new Va(a,!1)},renderToStaticNodeStream:function(a){return new Va(a,!0)},version:"16.8.3"},Xa={default:Wa},Ya=Xa&&Wa||Xa;module.exports=Ya.default||Ya;
+return b}(aa.Readable),Wa={renderToString:function(a){a=new Ta(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Ta(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(a){return new Va(a,!1)},renderToStaticNodeStream:function(a){return new Va(a,!0)},version:"16.8.4"},Xa={default:Wa},Ya=Xa&&Wa||Xa;module.exports=Ya.default||Ya;

cjs/react-dom-test-utils.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-test-utils.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-test-utils.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-test-utils.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-unstable-fire.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fire.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -10005,6 +10005,7 @@
this._debugSource = null;
this._debugOwner = null;
this._debugIsCurrentlyTiming = false;
+ this._debugHookTypes = null;
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
Object.preventExtensions(this);
}
@@ -10072,6 +10073,7 @@
workInProgress._debugID = current._debugID;
workInProgress._debugSource = current._debugSource;
workInProgress._debugOwner = current._debugOwner;
+ workInProgress._debugHookTypes = current._debugHookTypes;
}
workInProgress.alternate = current;
@@ -10339,6 +10341,7 @@
target._debugSource = source._debugSource;
target._debugOwner = source._debugOwner;
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
+ target._debugHookTypes = source._debugHookTypes;
return target;
}
@@ -12724,7 +12727,6 @@
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.
-var firstCurrentHook = null;
var currentHook = null;
var nextCurrentHook = null;
var firstWorkInProgressHook = null;
@@ -12754,23 +12756,53 @@
// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = null;
-function warnOnHookMismatchInDev() {
+// In DEV, this list ensures that hooks are called in the same order between renders.
+// The list stores the order of hooks used during the initial render (mount).
+// Subsequent renders (updates) reference this list.
+var hookTypesDev = null;
+var hookTypesUpdateIndexDev = -1;
+
+function mountHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev === null) {
+ hookTypesDev = [hookName];
+ } else {
+ hookTypesDev.push(hookName);
+ }
+ }
+}
+
+function updateHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev !== null) {
+ hookTypesUpdateIndexDev++;
+ if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
+ warnOnHookMismatchInDev(hookName);
+ }
+ }
+ }
+}
+
+function warnOnHookMismatchInDev(currentHookName) {
{
var componentName = getComponentName(currentlyRenderingFiber$1.type);
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
didWarnAboutMismatchedHooksForComponent.add(componentName);
- var secondColumnStart = 22;
-
+ if (hookTypesDev !== null) {
var table = '';
- var prevHook = firstCurrentHook;
- var nextHook = firstWorkInProgressHook;
- var n = 1;
- while (prevHook !== null && nextHook !== null) {
- var oldHookName = prevHook._debugType;
- var newHookName = nextHook._debugType;
- var row = n + '. ' + oldHookName;
+ var secondColumnStart = 30;
+
+ for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
+ var oldHookName = hookTypesDev[i];
+ var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
+
+ var row = i + 1 + '. ' + oldHookName;
// Extra space so second column lines up
// lol @ IE not supporting String#repeat
@@ -12781,12 +12813,10 @@
row += newHookName + '\n';
table += row;
- prevHook = prevHook.next;
- nextHook = nextHook.next;
- n++;
}
- 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);
+ 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);
+ }
}
}
}
@@ -12822,7 +12852,12 @@
function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
renderExpirationTime = nextRenderExpirationTime;
currentlyRenderingFiber$1 = workInProgress;
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
+
+ {
+ hookTypesDev = current !== null ? current._debugHookTypes : null;
+ hookTypesUpdateIndexDev = -1;
+ }
// The following should have already been reset
// currentHook = null;
@@ -12836,8 +12871,26 @@
// numberOfReRenders = 0;
// sideEffectTag = 0;
+ // TODO Warn if no hooks are used at all during mount, then some are used during update.
+ // Currently we will identify the update render as a mount because nextCurrentHook === null.
+ // This is tricky because it's valid for certain types of components (e.g. React.lazy)
+
+ // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
+ // Non-stateful hooks (e.g. context) don't get added to memoizedState,
+ // so nextCurrentHook would be null during updates and mounts.
{
- ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
+ if (nextCurrentHook !== null) {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
+ } else if (hookTypesDev !== null) {
+ // This dispatcher handles an edge case where a component is updating,
+ // but no stateful hooks have been used.
+ // We want to match the production code behavior (which will use HooksDispatcherOnMount),
+ // but with the extra DEV validation to ensure hooks ordering hasn't changed.
+ // This dispatcher does that.
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
+ } else {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
+ }
}
var children = Component(props, refOrContext);
@@ -12848,13 +12901,18 @@
numberOfReRenders += 1;
// Start over from the beginning of the list
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
nextWorkInProgressHook = firstWorkInProgressHook;
currentHook = null;
workInProgressHook = null;
componentUpdateQueue = null;
+ {
+ // Also validate hook order for cascading updates.
+ hookTypesUpdateIndexDev = -1;
+ }
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
children = Component(props, refOrContext);
@@ -12864,10 +12922,6 @@
numberOfReRenders = 0;
}
- {
- currentHookNameInDev = null;
- }
-
// We can assume the previous dispatcher is always this one, since we set it
// at the beginning of the render phase and there's no re-entrancy.
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
@@ -12879,18 +12933,29 @@
renderedWork.updateQueue = componentUpdateQueue;
renderedWork.effectTag |= sideEffectTag;
+ {
+ renderedWork._debugHookTypes = hookTypesDev;
+ }
+
+ // This check uses currentHook so that it works the same in DEV and prod bundles.
+ // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
+ {
+ currentHookNameInDev = null;
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+ }
+
remainingExpirationTime = NoWork;
componentUpdateQueue = null;
sideEffectTag = 0;
@@ -12924,21 +12989,23 @@
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
- remainingExpirationTime = NoWork;
- componentUpdateQueue = null;
- sideEffectTag = 0;
-
{
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+
currentHookNameInDev = null;
}
+ remainingExpirationTime = NoWork;
+ componentUpdateQueue = null;
+ sideEffectTag = 0;
+
didScheduleRenderPhaseUpdate = false;
renderPhaseUpdates = null;
numberOfReRenders = 0;
@@ -12955,9 +13022,6 @@
next: null
};
- {
- hook._debugType = currentHookNameInDev;
- }
if (workInProgressHook === null) {
// This is the first hook in the list
firstWorkInProgressHook = workInProgressHook = hook;
@@ -13004,13 +13068,6 @@
workInProgressHook = workInProgressHook.next = newHook;
}
nextCurrentHook = currentHook.next;
-
- {
- newHook._debugType = currentHookNameInDev;
- if (currentHookNameInDev !== currentHook._debugType) {
- warnOnHookMismatchInDev();
- }
- }
}
return workInProgressHook;
}
@@ -13025,20 +13082,6 @@
return typeof action === 'function' ? action(state) : action;
}
-function mountContext(context, observedBits) {
- {
- mountWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
-function updateContext(context, observedBits) {
- {
- updateWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
function mountReducer(reducer, initialArg, init) {
var hook = mountWorkInProgressHook();
var initialState = void 0;
@@ -13531,6 +13574,7 @@
};
var HooksDispatcherOnMountInDEV = null;
+var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
@@ -13550,26 +13594,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13580,6 +13630,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13590,10 +13641,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13604,6 +13657,81 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ mountHookTypesDev();
+ return mountDebugValue(value, formatterFn);
+ }
+ };
+
+ HooksDispatcherOnMountWithHookTypesInDEV = {
+ readContext: function (context, observedBits) {
+ return readContext(context, observedBits);
+ },
+ useCallback: function (callback, deps) {
+ currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
+ return mountCallback(callback, deps);
+ },
+ useContext: function (context, observedBits) {
+ currentHookNameInDev = 'useContext';
+ updateHookTypesDev();
+ return readContext(context, observedBits);
+ },
+ useEffect: function (create, deps) {
+ currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
+ return mountEffect(create, deps);
+ },
+ useImperativeHandle: function (ref, create, deps) {
+ currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
+ return mountImperativeHandle(ref, create, deps);
+ },
+ useLayoutEffect: function (create, deps) {
+ currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
+ return mountLayoutEffect(create, deps);
+ },
+ useMemo: function (create, deps) {
+ currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountMemo(create, deps);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useReducer: function (reducer, initialArg, init) {
+ currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountReducer(reducer, initialArg, init);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useRef: function (initialValue) {
+ currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
+ return mountRef(initialValue);
+ },
+ useState: function (initialState) {
+ currentHookNameInDev = 'useState';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountState(initialState);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useDebugValue: function (value, formatterFn) {
+ currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13614,26 +13742,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13644,6 +13778,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13654,10 +13789,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13668,6 +13805,7 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -13680,31 +13818,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13716,6 +13860,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13727,11 +13872,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13743,6 +13890,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13755,31 +13903,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13791,6 +13945,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13802,11 +13957,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13818,6 +13975,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -20552,7 +20710,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
// This file is copy paste from ReactDOM with adjusted paths
// and a different host config import (react-reconciler/inline.fire).

cjs/react-dom-unstable-fire.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fire.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -266,4 +266,4 @@
var Vi={createPortal:Ti,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?x("188"):x("268",Object.keys(a)));a=hd(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){Qi(b)?void 0:x("200");return Si(null,a,b,!0,c)},render:function(a,b,c){Qi(b)?void 0:x("200");return Si(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){Qi(c)?void 0:x("200");null==a||void 0===a._reactInternalFiber?
x("38"):void 0;return Si(a,b,c,!1,d)},unmountComponentAtNode:function(a){Qi(a)?void 0:x("40");return a._reactRootContainer?(Hi(function(){Si(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return Ti.apply(void 0,arguments)},unstable_batchedUpdates:Gi,unstable_interactiveUpdates:Ii,flushSync:function(a,b){W?x("187"):void 0;var c=X;X=!0;try{return ki(a,b)}finally{X=c,Yh(1073741823,!1)}},unstable_createRoot:Ui,unstable_flushControlled:function(a){var b=
X;X=!0;try{ki(a)}finally{(X=b)||W||Yh(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,Ba.injectEventPluginsByName,pa,Qa,function(a){ya(a,Pa)},Eb,Fb,Dd,Da]}};function Ui(a,b){Qi(a)?void 0:x("299","unstable_createRoot");return new Pi(a,!0,null!=b&&!0===b.hydrate)}
-(function(a){var b=a.findFiberByHostInstance;return Te(n({},a,{overrideProps:null,currentDispatcherRef:Tb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=hd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var Wi={default:Vi},Xi=Wi&&Vi||Wi;module.exports=Xi.default||Xi;
+(function(a){var b=a.findFiberByHostInstance;return Te(n({},a,{overrideProps:null,currentDispatcherRef:Tb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=hd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var Wi={default:Vi},Xi=Wi&&Vi||Wi;module.exports=Xi.default||Xi;

cjs/react-dom-unstable-fire.profiling.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fire.profiling.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -274,4 +274,4 @@
var ej={createPortal:cj,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?x("188"):x("268",Object.keys(a)));a=kd(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){$i(b)?void 0:x("200");return bj(null,a,b,!0,c)},render:function(a,b,c){$i(b)?void 0:x("200");return bj(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){$i(c)?void 0:x("200");null==a||void 0===a._reactInternalFiber?
x("38"):void 0;return bj(a,b,c,!1,d)},unmountComponentAtNode:function(a){$i(a)?void 0:x("40");return a._reactRootContainer?(Ri(function(){bj(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return cj.apply(void 0,arguments)},unstable_batchedUpdates:Qi,unstable_interactiveUpdates:Si,flushSync:function(a,b){V?x("187"):void 0;var c=W;W=!0;try{return wi(a,b)}finally{W=c,ii(1073741823,!1)}},unstable_createRoot:dj,unstable_flushControlled:function(a){var b=
W;W=!0;try{wi(a)}finally{(W=b)||V||ii(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,Ba.injectEventPluginsByName,pa,Ra,function(a){ya(a,Qa)},Gb,Hb,Gd,Da]}};function dj(a,b){$i(a)?void 0:x("299","unstable_createRoot");return new Zi(a,!0,null!=b&&!0===b.hydrate)}
-(function(a){var b=a.findFiberByHostInstance;return Xe(n({},a,{overrideProps:null,currentDispatcherRef:Wb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=kd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var fj={default:ej},gj=fj&&ej||fj;module.exports=gj.default||gj;
+(function(a){var b=a.findFiberByHostInstance;return Xe(n({},a,{overrideProps:null,currentDispatcherRef:Wb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=kd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var fj={default:ej},gj=fj&&ej||fj;module.exports=gj.default||gj;

cjs/react-dom-unstable-fizz.browser.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fizz.browser.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-unstable-fizz.browser.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fizz.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-unstable-fizz.node.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fizz.node.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-unstable-fizz.node.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fizz.node.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-unstable-native-dependencies.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-native-dependencies.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

cjs/react-dom-unstable-native-dependencies.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-native-dependencies.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

package.json

@@ -1,6 +1,6 @@
{
"name": "react-dom",
- "version": "16.8.3",
+ "version": "16.8.4",
"description": "React package for working with the DOM.",
"main": "index.js",
"repository": {
@@ -20,7 +20,7 @@
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
- "scheduler": "^0.13.3"
+ "scheduler": "^0.13.4"
},
"peerDependencies": {
"react": "^16.0.0"

umd/react-dom.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -10123,6 +10123,7 @@
this._debugSource = null;
this._debugOwner = null;
this._debugIsCurrentlyTiming = false;
+ this._debugHookTypes = null;
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
Object.preventExtensions(this);
}
@@ -10190,6 +10191,7 @@
workInProgress._debugID = current._debugID;
workInProgress._debugSource = current._debugSource;
workInProgress._debugOwner = current._debugOwner;
+ workInProgress._debugHookTypes = current._debugHookTypes;
}
workInProgress.alternate = current;
@@ -10457,6 +10459,7 @@
target._debugSource = source._debugSource;
target._debugOwner = source._debugOwner;
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
+ target._debugHookTypes = source._debugHookTypes;
return target;
}
@@ -12855,7 +12858,6 @@
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.
-var firstCurrentHook = null;
var currentHook = null;
var nextCurrentHook = null;
var firstWorkInProgressHook = null;
@@ -12885,23 +12887,53 @@
// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = null;
-function warnOnHookMismatchInDev() {
+// In DEV, this list ensures that hooks are called in the same order between renders.
+// The list stores the order of hooks used during the initial render (mount).
+// Subsequent renders (updates) reference this list.
+var hookTypesDev = null;
+var hookTypesUpdateIndexDev = -1;
+
+function mountHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev === null) {
+ hookTypesDev = [hookName];
+ } else {
+ hookTypesDev.push(hookName);
+ }
+ }
+}
+
+function updateHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev !== null) {
+ hookTypesUpdateIndexDev++;
+ if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
+ warnOnHookMismatchInDev(hookName);
+ }
+ }
+ }
+}
+
+function warnOnHookMismatchInDev(currentHookName) {
{
var componentName = getComponentName(currentlyRenderingFiber$1.type);
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
didWarnAboutMismatchedHooksForComponent.add(componentName);
- var secondColumnStart = 22;
-
+ if (hookTypesDev !== null) {
var table = '';
- var prevHook = firstCurrentHook;
- var nextHook = firstWorkInProgressHook;
- var n = 1;
- while (prevHook !== null && nextHook !== null) {
- var oldHookName = prevHook._debugType;
- var newHookName = nextHook._debugType;
- var row = n + '. ' + oldHookName;
+ var secondColumnStart = 30;
+
+ for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
+ var oldHookName = hookTypesDev[i];
+ var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
+
+ var row = i + 1 + '. ' + oldHookName;
// Extra space so second column lines up
// lol @ IE not supporting String#repeat
@@ -12912,12 +12944,10 @@
row += newHookName + '\n';
table += row;
- prevHook = prevHook.next;
- nextHook = nextHook.next;
- n++;
}
- 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);
+ 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);
+ }
}
}
}
@@ -12953,7 +12983,12 @@
function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
renderExpirationTime = nextRenderExpirationTime;
currentlyRenderingFiber$1 = workInProgress;
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
+
+ {
+ hookTypesDev = current !== null ? current._debugHookTypes : null;
+ hookTypesUpdateIndexDev = -1;
+ }
// The following should have already been reset
// currentHook = null;
@@ -12967,8 +13002,26 @@
// numberOfReRenders = 0;
// sideEffectTag = 0;
+ // TODO Warn if no hooks are used at all during mount, then some are used during update.
+ // Currently we will identify the update render as a mount because nextCurrentHook === null.
+ // This is tricky because it's valid for certain types of components (e.g. React.lazy)
+
+ // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
+ // Non-stateful hooks (e.g. context) don't get added to memoizedState,
+ // so nextCurrentHook would be null during updates and mounts.
{
- ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
+ if (nextCurrentHook !== null) {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
+ } else if (hookTypesDev !== null) {
+ // This dispatcher handles an edge case where a component is updating,
+ // but no stateful hooks have been used.
+ // We want to match the production code behavior (which will use HooksDispatcherOnMount),
+ // but with the extra DEV validation to ensure hooks ordering hasn't changed.
+ // This dispatcher does that.
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
+ } else {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
+ }
}
var children = Component(props, refOrContext);
@@ -12979,13 +13032,18 @@
numberOfReRenders += 1;
// Start over from the beginning of the list
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
nextWorkInProgressHook = firstWorkInProgressHook;
currentHook = null;
workInProgressHook = null;
componentUpdateQueue = null;
+ {
+ // Also validate hook order for cascading updates.
+ hookTypesUpdateIndexDev = -1;
+ }
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
children = Component(props, refOrContext);
@@ -12995,10 +13053,6 @@
numberOfReRenders = 0;
}
- {
- currentHookNameInDev = null;
- }
-
// We can assume the previous dispatcher is always this one, since we set it
// at the beginning of the render phase and there's no re-entrancy.
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
@@ -13010,18 +13064,29 @@
renderedWork.updateQueue = componentUpdateQueue;
renderedWork.effectTag |= sideEffectTag;
+ {
+ renderedWork._debugHookTypes = hookTypesDev;
+ }
+
+ // This check uses currentHook so that it works the same in DEV and prod bundles.
+ // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
+ {
+ currentHookNameInDev = null;
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+ }
+
remainingExpirationTime = NoWork;
componentUpdateQueue = null;
sideEffectTag = 0;
@@ -13055,21 +13120,23 @@
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
- remainingExpirationTime = NoWork;
- componentUpdateQueue = null;
- sideEffectTag = 0;
-
{
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+
currentHookNameInDev = null;
}
+ remainingExpirationTime = NoWork;
+ componentUpdateQueue = null;
+ sideEffectTag = 0;
+
didScheduleRenderPhaseUpdate = false;
renderPhaseUpdates = null;
numberOfReRenders = 0;
@@ -13086,9 +13153,6 @@
next: null
};
- {
- hook._debugType = currentHookNameInDev;
- }
if (workInProgressHook === null) {
// This is the first hook in the list
firstWorkInProgressHook = workInProgressHook = hook;
@@ -13135,13 +13199,6 @@
workInProgressHook = workInProgressHook.next = newHook;
}
nextCurrentHook = currentHook.next;
-
- {
- newHook._debugType = currentHookNameInDev;
- if (currentHookNameInDev !== currentHook._debugType) {
- warnOnHookMismatchInDev();
- }
- }
}
return workInProgressHook;
}
@@ -13156,20 +13213,6 @@
return typeof action === 'function' ? action(state) : action;
}
-function mountContext(context, observedBits) {
- {
- mountWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
-function updateContext(context, observedBits) {
- {
- updateWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
function mountReducer(reducer, initialArg, init) {
var hook = mountWorkInProgressHook();
var initialState = void 0;
@@ -13662,6 +13705,7 @@
};
var HooksDispatcherOnMountInDEV = null;
+var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
@@ -13681,26 +13725,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13711,6 +13761,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13721,10 +13772,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13735,6 +13788,81 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ mountHookTypesDev();
+ return mountDebugValue(value, formatterFn);
+ }
+ };
+
+ HooksDispatcherOnMountWithHookTypesInDEV = {
+ readContext: function (context, observedBits) {
+ return readContext(context, observedBits);
+ },
+ useCallback: function (callback, deps) {
+ currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
+ return mountCallback(callback, deps);
+ },
+ useContext: function (context, observedBits) {
+ currentHookNameInDev = 'useContext';
+ updateHookTypesDev();
+ return readContext(context, observedBits);
+ },
+ useEffect: function (create, deps) {
+ currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
+ return mountEffect(create, deps);
+ },
+ useImperativeHandle: function (ref, create, deps) {
+ currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
+ return mountImperativeHandle(ref, create, deps);
+ },
+ useLayoutEffect: function (create, deps) {
+ currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
+ return mountLayoutEffect(create, deps);
+ },
+ useMemo: function (create, deps) {
+ currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountMemo(create, deps);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useReducer: function (reducer, initialArg, init) {
+ currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountReducer(reducer, initialArg, init);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useRef: function (initialValue) {
+ currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
+ return mountRef(initialValue);
+ },
+ useState: function (initialState) {
+ currentHookNameInDev = 'useState';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountState(initialState);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useDebugValue: function (value, formatterFn) {
+ currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13745,26 +13873,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13775,6 +13909,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13785,10 +13920,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13799,6 +13936,7 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -13811,31 +13949,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13847,6 +13991,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13858,11 +14003,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13874,6 +14021,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13886,31 +14034,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13922,6 +14076,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13933,11 +14088,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13949,6 +14106,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -20683,7 +20841,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
// TODO: This type is shared between the reconciler and ReactDOM, but will
// eventually be lifted out to the renderer.

umd/react-dom.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -217,4 +217,4 @@
(function(a,b,c){Ye=a;yf=b;Ze=c})(Zg,ah,function(){w||0===oa||(Z(oa,!1),oa=0)});var oh={createPortal:ch,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=tf(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){ob(b)?void 0:n("200");return Wc(null,a,b,!0,c)},render:function(a,b,c){ob(b)?void 0:n("200");return Wc(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,
b,c,d){ob(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return Wc(a,b,c,!1,d)},unmountComponentAtNode:function(a){ob(a)?void 0:n("40");return a._reactRootContainer?($g(function(){Wc(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return ch.apply(void 0,arguments)},unstable_batchedUpdates:Zg,unstable_interactiveUpdates:ah,flushSync:function(a,b){w?n("187"):void 0;var c=z;z=!0;try{return Tg(a,b)}finally{z=c,Z(1073741823,!1)}},
unstable_createRoot:function(a,b){ob(a)?void 0:n("299","unstable_createRoot");return new nb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=z;z=!0;try{Tg(a)}finally{(z=b)||w||Z(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Je,Da,dd,Ae.injectEventPluginsByName,Zc,Qa,function(a){ad(a,xh)},Ve,We,oc,cd]}};(function(a){var b=a.findFiberByHostInstance;return ai(B({},a,{overrideProps:null,currentDispatcherRef:Ma.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=
-tf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:dc,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var ph={default:oh},qh=ph&&oh||ph;return qh.default||qh});
+tf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:dc,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var ph={default:oh},qh=ph&&oh||ph;return qh.default||qh});

umd/react-dom.profiling.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom.profiling.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -222,4 +222,4 @@
c=this._internalRoot,d=c.firstBatch;if(null===d)c.firstBatch=a,a._next=null;else{for(c=null;null!==d&&d._expirationTime>=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};(function(a,b,c){df=a;Ef=b;ef=c})(eh,gh,function(){x||0===qa||(aa(qa,!1),qa=0)});var uh={createPortal:ih,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=zf(b);a=null===a?null:a.stateNode;return a},
hydrate:function(a,b,c){sb(b)?void 0:n("200");return $c(null,a,b,!0,c)},render:function(a,b,c){sb(b)?void 0:n("200");return $c(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){sb(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return $c(a,b,c,!1,d)},unmountComponentAtNode:function(a){sb(a)?void 0:n("40");return a._reactRootContainer?(fh(function(){$c(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return ih.apply(void 0,
arguments)},unstable_batchedUpdates:eh,unstable_interactiveUpdates:gh,flushSync:function(a,b){x?n("187"):void 0;var c=y;y=!0;try{return Zg(a,b)}finally{y=c,aa(1073741823,!1)}},unstable_createRoot:function(a,b){sb(a)?void 0:n("299","unstable_createRoot");return new rb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=y;y=!0;try{Zg(a)}finally{(y=b)||x||aa(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Pe,Fa,id,Ge.injectEventPluginsByName,dd,Ua,function(a){fd(a,
-Dh)},af,bf,sc,hd]}};(function(a){var b=a.findFiberByHostInstance;return gi(z({},a,{overrideProps:null,currentDispatcherRef:Qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=zf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:hc,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var vh={default:uh},wh=vh&&uh||vh;return wh.default||wh});
+Dh)},af,bf,sc,hd]}};(function(a){var b=a.findFiberByHostInstance;return gi(z({},a,{overrideProps:null,currentDispatcherRef:Qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=zf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:hc,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var vh={default:uh},wh=vh&&uh||vh;return wh.default||wh});

umd/react-dom-server.browser.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-server.browser.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -62,7 +62,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

umd/react-dom-server.browser.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-server.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -40,5 +40,5 @@
for(y in h)if(Ka.call(h,y)){var m=h[y];if(null!=m){if("style"===y){r=void 0;var l="",q="";for(r in m)if(m.hasOwnProperty(r)){var n=0===r.indexOf("--"),t=m[r];if(null!=t){var v=r;if(W.hasOwnProperty(v))v=W[v];else{var x=v.replace(Ga,"-$1").toLowerCase().replace(Ha,"-ms-");v=W[v]=x}l+=q+v+":";q=r;n=null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||I.hasOwnProperty(q)&&I[q]?(""+t).trim():t+"px";l+=n;q=";"}}m=l||null}r=null;b:if(n=b,t=h,-1===n.indexOf("-"))n="string"===typeof t.is;
else switch(n){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":n=!1;break b;default:n=!0}if(n)La.hasOwnProperty(y)||(r=y,r=ha(r)&&null!=m?r+"="+('"'+C(m)+'"'):"");else{n=y;r=m;m=w.hasOwnProperty(n)?w[n]:null;if(t="style"!==n)t=null!==m?0===m.type:!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1]?!1:!0;t||xa(n,r,m,!1)?r="":null!==m?(n=m.attributeName,m=m.type,r=3===m||
4===m&&!0===r?n+'=""':n+"="+('"'+C(r)+'"')):r=ha(n)?n+"="+('"'+C(r)+'"'):""}r&&(p+=" "+r)}}g||k&&(p+=' data-reactroot=""');var y=p;h="";ra.hasOwnProperty(b)?y+="/>":(y+=">",h="</"+a.type+">");a:{g=e.dangerouslySetInnerHTML;if(null!=g){if(null!=g.__html){g=g.__html;break a}}else if(g=e.children,"string"===typeof g||"number"===typeof g){g=C(g);break a}g=null}null!=g?(e=[],Ia[b]&&"\n"===g.charAt(0)&&(y+="\n"),y+=g):e=B(e.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?pa(a):"http://www.w3.org/2000/svg"===
-c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:e,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return y};return a}();p={renderToString:function(a){a=new ta(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new ta(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){u("207")},renderToStaticNodeStream:function(){u("208")},version:"16.8.3"};
+c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:e,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return y};return a}();p={renderToString:function(a){a=new ta(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new ta(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){u("207")},renderToStaticNodeStream:function(){u("208")},version:"16.8.4"};
p=(D={default:p},p)||D;return p.default||p});

umd/react-dom-test-utils.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-test-utils.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

umd/react-dom-test-utils.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-test-utils.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

umd/react-dom-unstable-fire.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fire.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -10127,6 +10127,7 @@
this._debugSource = null;
this._debugOwner = null;
this._debugIsCurrentlyTiming = false;
+ this._debugHookTypes = null;
if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
Object.preventExtensions(this);
}
@@ -10194,6 +10195,7 @@
workInProgress._debugID = current._debugID;
workInProgress._debugSource = current._debugSource;
workInProgress._debugOwner = current._debugOwner;
+ workInProgress._debugHookTypes = current._debugHookTypes;
}
workInProgress.alternate = current;
@@ -10461,6 +10463,7 @@
target._debugSource = source._debugSource;
target._debugOwner = source._debugOwner;
target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
+ target._debugHookTypes = source._debugHookTypes;
return target;
}
@@ -12859,7 +12862,6 @@
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.
-var firstCurrentHook = null;
var currentHook = null;
var nextCurrentHook = null;
var firstWorkInProgressHook = null;
@@ -12889,23 +12891,53 @@
// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = null;
-function warnOnHookMismatchInDev() {
+// In DEV, this list ensures that hooks are called in the same order between renders.
+// The list stores the order of hooks used during the initial render (mount).
+// Subsequent renders (updates) reference this list.
+var hookTypesDev = null;
+var hookTypesUpdateIndexDev = -1;
+
+function mountHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev === null) {
+ hookTypesDev = [hookName];
+ } else {
+ hookTypesDev.push(hookName);
+ }
+ }
+}
+
+function updateHookTypesDev() {
+ {
+ var hookName = currentHookNameInDev;
+
+ if (hookTypesDev !== null) {
+ hookTypesUpdateIndexDev++;
+ if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
+ warnOnHookMismatchInDev(hookName);
+ }
+ }
+ }
+}
+
+function warnOnHookMismatchInDev(currentHookName) {
{
var componentName = getComponentName(currentlyRenderingFiber$1.type);
if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
didWarnAboutMismatchedHooksForComponent.add(componentName);
- var secondColumnStart = 22;
-
+ if (hookTypesDev !== null) {
var table = '';
- var prevHook = firstCurrentHook;
- var nextHook = firstWorkInProgressHook;
- var n = 1;
- while (prevHook !== null && nextHook !== null) {
- var oldHookName = prevHook._debugType;
- var newHookName = nextHook._debugType;
- var row = n + '. ' + oldHookName;
+ var secondColumnStart = 30;
+
+ for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
+ var oldHookName = hookTypesDev[i];
+ var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
+
+ var row = i + 1 + '. ' + oldHookName;
// Extra space so second column lines up
// lol @ IE not supporting String#repeat
@@ -12916,12 +12948,10 @@
row += newHookName + '\n';
table += row;
- prevHook = prevHook.next;
- nextHook = nextHook.next;
- n++;
}
- 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);
+ 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);
+ }
}
}
}
@@ -12957,7 +12987,12 @@
function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
renderExpirationTime = nextRenderExpirationTime;
currentlyRenderingFiber$1 = workInProgress;
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
+
+ {
+ hookTypesDev = current !== null ? current._debugHookTypes : null;
+ hookTypesUpdateIndexDev = -1;
+ }
// The following should have already been reset
// currentHook = null;
@@ -12971,8 +13006,26 @@
// numberOfReRenders = 0;
// sideEffectTag = 0;
+ // TODO Warn if no hooks are used at all during mount, then some are used during update.
+ // Currently we will identify the update render as a mount because nextCurrentHook === null.
+ // This is tricky because it's valid for certain types of components (e.g. React.lazy)
+
+ // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
+ // Non-stateful hooks (e.g. context) don't get added to memoizedState,
+ // so nextCurrentHook would be null during updates and mounts.
{
- ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
+ if (nextCurrentHook !== null) {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
+ } else if (hookTypesDev !== null) {
+ // This dispatcher handles an edge case where a component is updating,
+ // but no stateful hooks have been used.
+ // We want to match the production code behavior (which will use HooksDispatcherOnMount),
+ // but with the extra DEV validation to ensure hooks ordering hasn't changed.
+ // This dispatcher does that.
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
+ } else {
+ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
+ }
}
var children = Component(props, refOrContext);
@@ -12983,13 +13036,18 @@
numberOfReRenders += 1;
// Start over from the beginning of the list
- firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
+ nextCurrentHook = current !== null ? current.memoizedState : null;
nextWorkInProgressHook = firstWorkInProgressHook;
currentHook = null;
workInProgressHook = null;
componentUpdateQueue = null;
+ {
+ // Also validate hook order for cascading updates.
+ hookTypesUpdateIndexDev = -1;
+ }
+
ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
children = Component(props, refOrContext);
@@ -12999,10 +13057,6 @@
numberOfReRenders = 0;
}
- {
- currentHookNameInDev = null;
- }
-
// We can assume the previous dispatcher is always this one, since we set it
// at the beginning of the render phase and there's no re-entrancy.
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
@@ -13014,18 +13068,29 @@
renderedWork.updateQueue = componentUpdateQueue;
renderedWork.effectTag |= sideEffectTag;
+ {
+ renderedWork._debugHookTypes = hookTypesDev;
+ }
+
+ // This check uses currentHook so that it works the same in DEV and prod bundles.
+ // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
+ {
+ currentHookNameInDev = null;
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+ }
+
remainingExpirationTime = NoWork;
componentUpdateQueue = null;
sideEffectTag = 0;
@@ -13059,21 +13124,23 @@
renderExpirationTime = NoWork;
currentlyRenderingFiber$1 = null;
- firstCurrentHook = null;
currentHook = null;
nextCurrentHook = null;
firstWorkInProgressHook = null;
workInProgressHook = null;
nextWorkInProgressHook = null;
- remainingExpirationTime = NoWork;
- componentUpdateQueue = null;
- sideEffectTag = 0;
-
{
+ hookTypesDev = null;
+ hookTypesUpdateIndexDev = -1;
+
currentHookNameInDev = null;
}
+ remainingExpirationTime = NoWork;
+ componentUpdateQueue = null;
+ sideEffectTag = 0;
+
didScheduleRenderPhaseUpdate = false;
renderPhaseUpdates = null;
numberOfReRenders = 0;
@@ -13090,9 +13157,6 @@
next: null
};
- {
- hook._debugType = currentHookNameInDev;
- }
if (workInProgressHook === null) {
// This is the first hook in the list
firstWorkInProgressHook = workInProgressHook = hook;
@@ -13139,13 +13203,6 @@
workInProgressHook = workInProgressHook.next = newHook;
}
nextCurrentHook = currentHook.next;
-
- {
- newHook._debugType = currentHookNameInDev;
- if (currentHookNameInDev !== currentHook._debugType) {
- warnOnHookMismatchInDev();
- }
- }
}
return workInProgressHook;
}
@@ -13160,20 +13217,6 @@
return typeof action === 'function' ? action(state) : action;
}
-function mountContext(context, observedBits) {
- {
- mountWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
-function updateContext(context, observedBits) {
- {
- updateWorkInProgressHook();
- }
- return readContext(context, observedBits);
-}
-
function mountReducer(reducer, initialArg, init) {
var hook = mountWorkInProgressHook();
var initialState = void 0;
@@ -13666,6 +13709,7 @@
};
var HooksDispatcherOnMountInDEV = null;
+var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
@@ -13685,26 +13729,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13715,6 +13765,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13725,10 +13776,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13739,6 +13792,81 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ mountHookTypesDev();
+ return mountDebugValue(value, formatterFn);
+ }
+ };
+
+ HooksDispatcherOnMountWithHookTypesInDEV = {
+ readContext: function (context, observedBits) {
+ return readContext(context, observedBits);
+ },
+ useCallback: function (callback, deps) {
+ currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
+ return mountCallback(callback, deps);
+ },
+ useContext: function (context, observedBits) {
+ currentHookNameInDev = 'useContext';
+ updateHookTypesDev();
+ return readContext(context, observedBits);
+ },
+ useEffect: function (create, deps) {
+ currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
+ return mountEffect(create, deps);
+ },
+ useImperativeHandle: function (ref, create, deps) {
+ currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
+ return mountImperativeHandle(ref, create, deps);
+ },
+ useLayoutEffect: function (create, deps) {
+ currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
+ return mountLayoutEffect(create, deps);
+ },
+ useMemo: function (create, deps) {
+ currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountMemo(create, deps);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useReducer: function (reducer, initialArg, init) {
+ currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountReducer(reducer, initialArg, init);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useRef: function (initialValue) {
+ currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
+ return mountRef(initialValue);
+ },
+ useState: function (initialState) {
+ currentHookNameInDev = 'useState';
+ updateHookTypesDev();
+ var prevDispatcher = ReactCurrentDispatcher$1.current;
+ ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
+ try {
+ return mountState(initialState);
+ } finally {
+ ReactCurrentDispatcher$1.current = prevDispatcher;
+ }
+ },
+ useDebugValue: function (value, formatterFn) {
+ currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13749,26 +13877,32 @@
},
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13779,6 +13913,7 @@
},
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13789,10 +13924,12 @@
},
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13803,6 +13940,7 @@
},
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -13815,31 +13953,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return mountContext(context, observedBits);
+ mountHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13851,6 +13995,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13862,11 +14007,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ mountHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
try {
@@ -13878,6 +14025,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ mountHookTypesDev();
return mountDebugValue(value, formatterFn);
}
};
@@ -13890,31 +14038,37 @@
useCallback: function (callback, deps) {
currentHookNameInDev = 'useCallback';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateCallback(callback, deps);
},
useContext: function (context, observedBits) {
currentHookNameInDev = 'useContext';
warnInvalidHookAccess();
- return updateContext(context, observedBits);
+ updateHookTypesDev();
+ return readContext(context, observedBits);
},
useEffect: function (create, deps) {
currentHookNameInDev = 'useEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateEffect(create, deps);
},
useImperativeHandle: function (ref, create, deps) {
currentHookNameInDev = 'useImperativeHandle';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateImperativeHandle(ref, create, deps);
},
useLayoutEffect: function (create, deps) {
currentHookNameInDev = 'useLayoutEffect';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateLayoutEffect(create, deps);
},
useMemo: function (create, deps) {
currentHookNameInDev = 'useMemo';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13926,6 +14080,7 @@
useReducer: function (reducer, initialArg, init) {
currentHookNameInDev = 'useReducer';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13937,11 +14092,13 @@
useRef: function (initialValue) {
currentHookNameInDev = 'useRef';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateRef(initialValue);
},
useState: function (initialState) {
currentHookNameInDev = 'useState';
warnInvalidHookAccess();
+ updateHookTypesDev();
var prevDispatcher = ReactCurrentDispatcher$1.current;
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
@@ -13953,6 +14110,7 @@
useDebugValue: function (value, formatterFn) {
currentHookNameInDev = 'useDebugValue';
warnInvalidHookAccess();
+ updateHookTypesDev();
return updateDebugValue(value, formatterFn);
}
};
@@ -20687,7 +20845,7 @@
// TODO: this is special because it gets imported during build.
-var ReactVersion = '16.8.3';
+var ReactVersion = '16.8.4';
// This file is copy paste from ReactDOM with adjusted paths
// and a different host config import (react-reconciler/inline.fire).

umd/react-dom-unstable-fire.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fire.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -217,4 +217,4 @@
(function(a,b,c){Ye=a;yf=b;Ze=c})(Zg,ah,function(){w||0===oa||(Z(oa,!1),oa=0)});var oh={createPortal:ch,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=tf(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){ob(b)?void 0:n("200");return Wc(null,a,b,!0,c)},render:function(a,b,c){ob(b)?void 0:n("200");return Wc(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,
b,c,d){ob(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return Wc(a,b,c,!1,d)},unmountComponentAtNode:function(a){ob(a)?void 0:n("40");return a._reactRootContainer?($g(function(){Wc(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return ch.apply(void 0,arguments)},unstable_batchedUpdates:Zg,unstable_interactiveUpdates:ah,flushSync:function(a,b){w?n("187"):void 0;var c=z;z=!0;try{return Tg(a,b)}finally{z=c,Z(1073741823,!1)}},
unstable_createRoot:function(a,b){ob(a)?void 0:n("299","unstable_createRoot");return new nb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=z;z=!0;try{Tg(a)}finally{(z=b)||w||Z(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Je,Da,dd,Ae.injectEventPluginsByName,Zc,Qa,function(a){ad(a,xh)},Ve,We,oc,cd]}};(function(a){var b=a.findFiberByHostInstance;return ai(B({},a,{overrideProps:null,currentDispatcherRef:Ma.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=
-tf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:dc,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var ph={default:oh},qh=ph&&oh||ph;return qh.default||qh});
+tf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:dc,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var ph={default:oh},qh=ph&&oh||ph;return qh.default||qh});

umd/react-dom-unstable-fire.profiling.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fire.profiling.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
@@ -222,4 +222,4 @@
c=this._internalRoot,d=c.firstBatch;if(null===d)c.firstBatch=a,a._next=null;else{for(c=null;null!==d&&d._expirationTime>=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};(function(a,b,c){df=a;Ef=b;ef=c})(eh,gh,function(){x||0===qa||(aa(qa,!1),qa=0)});var uh={createPortal:ih,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=zf(b);a=null===a?null:a.stateNode;return a},
hydrate:function(a,b,c){sb(b)?void 0:n("200");return $c(null,a,b,!0,c)},render:function(a,b,c){sb(b)?void 0:n("200");return $c(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){sb(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return $c(a,b,c,!1,d)},unmountComponentAtNode:function(a){sb(a)?void 0:n("40");return a._reactRootContainer?(fh(function(){$c(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return ih.apply(void 0,
arguments)},unstable_batchedUpdates:eh,unstable_interactiveUpdates:gh,flushSync:function(a,b){x?n("187"):void 0;var c=y;y=!0;try{return Zg(a,b)}finally{y=c,aa(1073741823,!1)}},unstable_createRoot:function(a,b){sb(a)?void 0:n("299","unstable_createRoot");return new rb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=y;y=!0;try{Zg(a)}finally{(y=b)||x||aa(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Pe,Fa,id,Ge.injectEventPluginsByName,dd,Ua,function(a){fd(a,
-Dh)},af,bf,sc,hd]}};(function(a){var b=a.findFiberByHostInstance;return gi(z({},a,{overrideProps:null,currentDispatcherRef:Qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=zf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:hc,bundleType:0,version:"16.8.3",rendererPackageName:"react-dom"});var vh={default:uh},wh=vh&&uh||vh;return wh.default||wh});
+Dh)},af,bf,sc,hd]}};(function(a){var b=a.findFiberByHostInstance;return gi(z({},a,{overrideProps:null,currentDispatcherRef:Qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=zf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:hc,bundleType:0,version:"16.8.4",rendererPackageName:"react-dom"});var vh={default:uh},wh=vh&&uh||vh;return wh.default||wh});

umd/react-dom-unstable-fizz.browser.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fizz.browser.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

umd/react-dom-unstable-fizz.browser.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-fizz.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

umd/react-dom-unstable-native-dependencies.development.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-native-dependencies.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.

umd/react-dom-unstable-native-dependencies.production.min.js

@@ -1,4 +1,4 @@
-/** @license React v16.8.3
+/** @license React v16.8.4
* react-dom-unstable-native-dependencies.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.