diff --git a/packages/react-native/ReactCommon/react/cxxstableapi/FrameworksGuard.h b/packages/react-native/ReactCommon/react/cxxstableapi/FrameworksGuard.h index 3f73494371c3..df3743c06de8 100644 --- a/packages/react-native/ReactCommon/react/cxxstableapi/FrameworksGuard.h +++ b/packages/react-native/ReactCommon/react/cxxstableapi/FrameworksGuard.h @@ -13,23 +13,25 @@ // #include // // "For frameworks" headers are APIs intended for framework authors integrating -// React Native, not for ordinary app code. Including one directly emits a -// SUPPRESSIBLE warning under enforcement. A framework author acknowledges the -// usage by defining `RN_ALLOW_FRAMEWORKS`, which silences the warning. +// React Native, not for ordinary app code. Including one, directly or +// transitively, emits a SUPPRESSIBLE warning under enforcement. A framework +// author acknowledges the usage by defining `RN_ALLOW_FRAMEWORKS`, which +// silences the warning. Module umbrellas never re-export these headers, so +// `RN_UMBRELLA_CONTEXT` does not suppress the warning: a public header that +// includes a for-frameworks header leaks it, and is reported. // // See for the full `RN_*` macro contract. // In short: // RN_STRICT_API Consumer opt-in master switch; the guard is inert // without it. // RN_ALLOW_FRAMEWORKS Consumer opt-out acknowledging framework-tier usage. -// RN_UMBRELLA_CONTEXT Internal marker set by an umbrella around its includes. // RN_BUILDING Set by React Native's own build. // // This header is intentionally NOT `#pragma once`-guarded: it must be -// re-evaluated on every inclusion so each direct include is checked. +// re-evaluated on every inclusion so each include is checked. // ============================================================================= -#if defined(RN_STRICT_API) && !defined(RN_ALLOW_FRAMEWORKS) && !defined(RN_UMBRELLA_CONTEXT) && !defined(RN_BUILDING) +#if defined(RN_STRICT_API) && !defined(RN_ALLOW_FRAMEWORKS) && !defined(RN_BUILDING) #warning \ - "This is a 'for frameworks' React Native API, intended for framework authors rather than app code. Include it via the module umbrella .h>, or define RN_ALLOW_FRAMEWORKS to acknowledge framework-tier usage and silence this warning." + "This is a 'for frameworks' React Native API, intended for framework authors rather than app code. Define RN_ALLOW_FRAMEWORKS to acknowledge framework-tier usage and silence this warning." #endif