File tree 1 file changed +11
-12
lines changed
1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,9 @@ var hotCompareElements = function (oldType, newType) {
49
49
return oldType === newType
50
50
};
51
51
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
+ }
61
55
}
62
56
var ReactDOM = {
63
57
evalInReactContext: function (injection) {
@@ -67,9 +61,14 @@ var ReactDOM = {
67
61
hotRenderWithHooks: function (current, render) {
68
62
hotCleanupHooks();
69
63
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
+ }
73
72
74
73
var rendered = render();
75
74
You can’t perform that action at this time.
0 commit comments