Skip to content

Commit c8ce989

Browse files
committed
refactor(core): Simplify 'scan' method in ReactScanInternals
1 parent 00c966a commit c8ce989

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export const withScan = <T>(
344344
) => {
345345
setOptions(options);
346346
const { isInIframe, componentAllowList } = ReactScanInternals;
347-
if (isInIframe) return component;
347+
if (isInIframe || options.enabled === false) return component;
348348
if (!componentAllowList) {
349349
ReactScanInternals.componentAllowList = new WeakMap<
350350
React.ComponentType<any>,
@@ -363,7 +363,7 @@ export const withScan = <T>(
363363
export const scan = (options: Options = {}) => {
364364
setOptions(options);
365365
const { isInIframe } = ReactScanInternals;
366-
if (isInIframe) return;
366+
if (isInIframe || options.enabled === false) return;
367367

368368
start();
369369
};

0 commit comments

Comments
 (0)