Skip to content

Commit ef2a050

Browse files
Dominik WienandLukeDurrant
Dominik Wienand
authored andcommitted
Use .includes instead of .startsWith for checking ignored YellowBox warnings
Summary: Some warnings don't have a good prefix that can be targeted using .startsWith, e.g. "Module $modulename requires main queue setup". It would be helpful to be able to select this warning using the much more specific middle part of the string ("requires main queue setup since it overrides `constantsToExport`) so I want to change this check from startsWith to includes to enable that. Changing from .startsWith -> .includes should be completely backward compatible. Reviewed By: TheSavior Differential Revision: D7445309 fbshipit-source-id: 2c91dbe5ee3c3aa74be1bca091b20d294e64e853
1 parent 920f7ab commit ef2a050

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/ReactNative/YellowBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function ensureSymbolicatedWarning(warning: string): void {
172172

173173
function isWarningIgnored(warning: string): boolean {
174174
const isIgnored = IGNORED_WARNINGS.some((ignoredWarning: string) =>
175-
warning.startsWith(ignoredWarning),
175+
warning.includes(ignoredWarning),
176176
);
177177

178178
if (isIgnored) {

0 commit comments

Comments
 (0)