Skip to content

Commit 70c57f4

Browse files
committed
perf: only create deprecation message if we will use it
1 parent c4d5dca commit 70c57f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/app/lib/common/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,9 @@ export function deprecationConsoleWarning(nameSpace, methodName, instanceName, i
224224
const instanceMap = moduleMap[instanceName];
225225
const deprecatedMethod = instanceMap[methodName];
226226
if (instanceMap && deprecatedMethod) {
227-
const message = createMessage(nameSpace, methodName, instanceName);
228-
229227
if (!globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS) {
230228
// eslint-disable-next-line no-console
231-
console.warn(message);
229+
console.warn(createMessage(nameSpace, methodName, instanceName));
232230
}
233231
}
234232
}

0 commit comments

Comments
 (0)