From 4526905637168145b5d786927c1f6dae228bcba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 13 Oct 2026 02:51:38 -0700 Subject: [PATCH] Classify componentNameByReactViewName.h as for-frameworks Summary: Move `componentNameByReactViewName.h` from the private tier back to the for-frameworks tier. The function maps legacy view names to Fabric component names. React Native itself only uses it inside the component registry and the iOS component view factory, and it is transitional, but libraries that integrate with the renderer call it directly; for example, an animation library uses it to resolve the component name for a view in its native module. Under `RN_STRICT_API` a private header is a hard error with no opt-out, so those libraries could not build at all. As for-frameworks, they get a warning that `RN_ALLOW_FRAMEWORKS` silences, and the function stays out of the public API. Changelog: [Internal] Differential Revision: D124970095 --- .../renderer/componentregistry/componentNameByReactViewName.h | 2 +- scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api | 1 + scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api | 1 + scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.h b/packages/react-native/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.h index a5371eea7793..8b3702c689af 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.h +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/componentNameByReactViewName.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api index e1915564eeed..d8d288f39f5b 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api @@ -784,6 +784,7 @@ std::optional facebook::react::filterTypeFromString std::optional facebook::react::optionalFloatFromYogaValue(const facebook::yoga::Style::Length& length, std::optional base = {}); std::optional facebook::react::fontVariantFromCSSFontVariant(facebook::react::CSSFontVariant cssVariant); std::optional facebook::react::isolationFromString(std::string_view isolationSetting); +std::string facebook::react::componentNameByReactViewName(std::string viewName); std::string facebook::react::toString(const double& value); std::string facebook::react::toString(const facebook::react::AccessibilityRole& accessibilityRole); std::string facebook::react::toString(const facebook::react::AttributedString::Range& range); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index 11c7e6873789..6ce823b30a95 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -3569,6 +3569,7 @@ std::optional facebook::react::filterTypeFromString std::optional facebook::react::optionalFloatFromYogaValue(const facebook::yoga::Style::Length& length, std::optional base = {}); std::optional facebook::react::fontVariantFromCSSFontVariant(facebook::react::CSSFontVariant cssVariant); std::optional facebook::react::isolationFromString(std::string_view isolationSetting); +std::string facebook::react::componentNameByReactViewName(std::string viewName); std::string facebook::react::toString(const double& value); std::string facebook::react::toString(const facebook::react::AccessibilityRole& accessibilityRole); std::string facebook::react::toString(const facebook::react::AttributedString::Range& range); diff --git a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api index bcf1840858e3..0363e6c46881 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api @@ -359,6 +359,7 @@ std::optional facebook::react::blendModeFromString(s std::optional facebook::react::filterTypeFromString(std::string_view filterName); std::optional facebook::react::fontVariantFromCSSFontVariant(facebook::react::CSSFontVariant cssVariant); std::optional facebook::react::isolationFromString(std::string_view isolationSetting); +std::string facebook::react::componentNameByReactViewName(std::string viewName); std::string facebook::react::toString(const double& value); std::string facebook::react::toString(const facebook::react::AccessibilityRole& accessibilityRole); std::string facebook::react::toString(const facebook::react::AttributedString::Range& range);