diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor.js b/packages/react-native/scripts/codegen/generate-artifacts-executor.js index c1fc5aeaf99..440b25c02a7 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor.js @@ -778,6 +778,11 @@ function findFilesWithExtension(filePath, extension) { // Given a filepath, read the file and look for a string that starts with 'Class ' // and ends with 'Cls(void)'. Return the string between the two. function findRCTComponentViewProtocolClass(filepath) { + // Exclude files provided by react-native + if (filepath.includes(`${path.sep}react-native${path.sep}`)) { + return null; + } + const fileContent = fs.readFileSync(filepath, 'utf8'); const regex = /Class (.*)Cls\(/; const match = fileContent.match(regex);