mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Stop using RTTI features in Fabric core and components
Summary: These dynamic_casts aren't really giving us much (they have never fired once in dev! and don't run in prod anyway). They also prevent us from disabling RTTI. So, let's get rid of them. Changelog: [Internal] Reviewed By: philIip Differential Revision: D31634895 fbshipit-source-id: 4a9b259837127feb324f64fa3e9e23eb1cc481a6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f7a33e3501
commit
6525f9b082
@@ -11,6 +11,8 @@ rn_xplat_cxx_library(
|
||||
],
|
||||
prefix = "react/fabric",
|
||||
),
|
||||
compiler_flags_enable_exceptions = True,
|
||||
compiler_flags_enable_rtti = True, # dynamic_cast used within Binding.cpp
|
||||
fbandroid_allow_jni_merging = True,
|
||||
labels = ["supermodule:xplat/default/public.react_native.infra"],
|
||||
platforms = ANDROID,
|
||||
|
||||
@@ -646,16 +646,19 @@ inline local_ref<ReadableArray::javaobject> castReadableArray(
|
||||
|
||||
// TODO: this method will be removed when binding for components are code-gen
|
||||
local_ref<JString> getPlatformComponentName(const ShadowView &shadowView) {
|
||||
local_ref<JString> componentName;
|
||||
auto newViewProps =
|
||||
std::dynamic_pointer_cast<const ScrollViewProps>(shadowView.props);
|
||||
static std::string scrollViewComponentName = std::string("ScrollView");
|
||||
|
||||
if (newViewProps &&
|
||||
newViewProps->getProbablyMoreHorizontalThanVertical_DEPRECATED()) {
|
||||
componentName = make_jstring("AndroidHorizontalScrollView");
|
||||
} else {
|
||||
componentName = make_jstring(shadowView.componentName);
|
||||
local_ref<JString> componentName;
|
||||
if (scrollViewComponentName.compare(shadowView.componentName) == 0) {
|
||||
auto newViewProps =
|
||||
std::static_pointer_cast<const ScrollViewProps>(shadowView.props);
|
||||
if (newViewProps->getProbablyMoreHorizontalThanVertical_DEPRECATED()) {
|
||||
componentName = make_jstring("AndroidHorizontalScrollView");
|
||||
return componentName;
|
||||
}
|
||||
}
|
||||
|
||||
componentName = make_jstring(shadowView.componentName);
|
||||
return componentName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user