react-refresh
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -465,14 +465,24 @@ /** @license React vundefined | ||
{ | ||
var call = 0; | ||
// We'll fill in the signature in two steps. | ||
// First, we'll know the signature itself. This happens outside the component. | ||
// Then, we'll know the references to custom Hooks. This happens inside the component. | ||
// After that, the returned function will be a fast path no-op. | ||
var status = 'needsSignature'; | ||
var savedType; | ||
var hasCustomHooks; | ||
return function (type, key, forceReset, getCustomHooks) { | ||
switch (call++) { | ||
case 0: | ||
savedType = type; | ||
hasCustomHooks = typeof getCustomHooks === 'function'; | ||
setSignature(type, key, forceReset, getCustomHooks); | ||
switch (status) { | ||
case 'needsSignature': | ||
if (type !== undefined) { | ||
// If we received an argument, this is the initial registration call. | ||
savedType = type; | ||
hasCustomHooks = typeof getCustomHooks === 'function'; | ||
setSignature(type, key, forceReset, getCustomHooks); // The next call we expect is from inside a function, to fill in the custom Hooks. | ||
status = 'needsCustomHooks'; | ||
} | ||
break; | ||
case 1: | ||
case 'needsCustomHooks': | ||
if (hasCustomHooks) { | ||
@@ -482,3 +492,8 @@ collectCustomHooksForSignature(savedType); | ||
status = 'resolved'; | ||
break; | ||
case 'resolved': | ||
// Do nothing. Fast path for all future renders. | ||
break; | ||
} | ||
@@ -485,0 +500,0 @@ |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"homepage": "https://reactjs.org/", | ||
@@ -10,0 +10,0 @@ "bugs": "https://github.com/facebook/react/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52263
1146