react-refresh
Advanced tools
@@ -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 @@ |
+1
-1
@@ -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", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
52263
1.43%1146
1.06%