Skip to content

Commit 38b63cd

Browse files
committed
feat: support 16.8.4
1 parent 94d1379 commit 38b63cd

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Diff for: src/webpack/patch.js

+11-12
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,9 @@ var hotCompareElements = function (oldType, newType) {
4949
return oldType === newType
5050
};
5151
var hotCleanupHooks = function () {
52-
firstCurrentHook = null;
53-
currentHook = null;
54-
firstWorkInProgressHook = null;
55-
workInProgressHook = null;
56-
nextWorkInProgressHook = null;
57-
58-
remainingExpirationTime = NoWork;
59-
componentUpdateQueue = null;
60-
sideEffectTag = 0;
52+
if (typeof resetHooks !== 'undefined') {
53+
resetHooks();
54+
}
6155
}
6256
var ReactDOM = {
6357
evalInReactContext: function (injection) {
@@ -67,9 +61,14 @@ var ReactDOM = {
6761
hotRenderWithHooks: function (current, render) {
6862
hotCleanupHooks();
6963
70-
firstCurrentHook = nextCurrentHook = current !== null ? current.memoizedState : null;
71-
72-
ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
64+
if (typeof nextCurrentHook !== 'undefined' && typeof ReactCurrentDispatcher$1 !== 'undefined') {
65+
nextCurrentHook = current !== null ? current.memoizedState : null;
66+
if(typeof firstCurrentHook !== 'undefined') {
67+
firstCurrentHook = nextCurrentHook;
68+
}
69+
70+
ReactCurrentDispatcher$1.current = nextCurrentHook === null ? HooksDispatcherOnMountInDEV : HooksDispatcherOnUpdateInDEV;
71+
}
7372
7473
var rendered = render();
7574

0 commit comments

Comments
 (0)