From 0bab0523ac04861904f790303320aac442cabc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Thu, 22 Oct 2026 00:57:03 -0700 Subject: [PATCH] Build RN-Tester with RN_STRICT_API (#59223) Summary: Pull Request resolved: https://github.com/react/react-native/pull/59223 Turn on the C++ stable API checks (`RN_STRICT_API`) in RN-Tester by default, so the opt-ins and React Native's app-facing headers are exercised in strict mode on every build: - Android: `strictCxxApiEnabled=true` in `android/app/gradle.properties`. - iOS (CocoaPods): the Podfile sets `RN_STRICT_API=1` unless the environment already sets it, so `pod install` applies it the same way an app would. Changelog: [Internal] ___ landed-with-radar-review Differential Revision: D126330702 fbshipit-source-id: 561bcc9ddb4dc5ce75347620748fbdc26ddc7304 --- packages/rn-tester/Podfile | 3 +++ packages/rn-tester/android/app/gradle.properties | 2 ++ 2 files changed, 5 insertions(+) diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 24b30cffa59..2ccaa665087 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -21,6 +21,9 @@ end prepare_react_native_project! +# RN-Tester builds with the C++ stable API enforced. Run `RN_STRICT_API=0 pod install` to opt out. +ENV['RN_STRICT_API'] ||= '1' + @prefix_path = "../react-native" linkage = ENV['USE_FRAMEWORKS'] diff --git a/packages/rn-tester/android/app/gradle.properties b/packages/rn-tester/android/app/gradle.properties index 5c17e99d3fa..61586cfbe8c 100644 --- a/packages/rn-tester/android/app/gradle.properties +++ b/packages/rn-tester/android/app/gradle.properties @@ -9,3 +9,5 @@ newArchEnabled=true hermesEnabled=true # RN-Tester is running with EdgeToEdge always enabled edgeToEdgeEnabled=true +# RN-Tester is building with the C++ stable API enforced +strictCxxApiEnabled=true