diff --git a/packages/react-native/react-native.config.js b/packages/react-native/react-native.config.js index 46579f1475b48b..4fc760e979c04d 100644 --- a/packages/react-native/react-native.config.js +++ b/packages/react-native/react-native.config.js @@ -71,8 +71,14 @@ try { // [macOS let apple; try { + const iosPath = require.resolve('@react-native-community/cli-platform-ios', { + paths: [process.cwd()], + }); // $FlowFixMe[untyped-import] - apple = require('@react-native-community/cli-platform-apple'); + apple = findCommunityPlatformPackage( + '@react-native-community/cli-platform-apple', + iosPath, + ); } catch { if (verbose) { console.warn( @@ -156,7 +162,7 @@ if (android != null) { // [macOS config.commands.push(...macosCommands); -if (apple != null) { +if (apple) { config.platforms.macos = { linkConfig: () => { return {