Skip to content

Commit

Permalink
xplat/js/react-native-github/packages/react-native/ReactAndroid/src/m…
Browse files Browse the repository at this point in the history
…ain/java/com/facebook/react/fabric/FabricComponents.java (#45673)

Summary:
Pull Request resolved: #45673

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D60233417

fbshipit-source-id: f5506b8d2bf0e2246c8578c0c1c13ddd62507ee0
  • Loading branch information
andrewdacenko authored and facebook-github-bot committed Jul 26, 2024
1 parent 87ff232 commit 77dfa43
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 57 deletions.
6 changes: 3 additions & 3 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2586,9 +2586,9 @@ public final class com/facebook/react/fabric/EmptyReactNativeConfig : com/facebo
public fun getString (Ljava/lang/String;)Ljava/lang/String;
}

public class com/facebook/react/fabric/FabricComponents {
public fun <init> ()V
public static fun getFabricComponentName (Ljava/lang/String;)Ljava/lang/String;
public final class com/facebook/react/fabric/FabricComponents {
public static final field INSTANCE Lcom/facebook/react/fabric/FabricComponents;
public static final fun getFabricComponentName (Ljava/lang/String;)Ljava/lang/String;
}

public final class com/facebook/react/fabric/FabricSoLoader {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.fabric

/**
* Utility class for Fabric components, this will be removed
*
* TODO T97384889: remove this class when the component names are unified between JS - Android -
* iOS - C++
*/
public object FabricComponents {

// TODO T97384889: unify component names between JS - Android - iOS - C++
private val componentNames: Map<String, String> =
mapOf(
"View" to "RCTView",
"Image" to "RCTImageView",
"ScrollView" to "RCTScrollView",
"Slider" to "RCTSlider",
"ModalHostView" to "RCTModalHostView",
"Paragraph" to "RCTText",
"Text" to "RCText",
"RawText" to "RCTRawText",
"ActivityIndicatorView" to "AndroidProgressBar",
"ShimmeringView" to "RKShimmeringView",
"TemplateView" to "RCTTemplateView",
"AxialGradientView" to "RCTAxialGradientView",
"Video" to "RCTVideo",
"Map" to "RCTMap",
"WebView" to "RCTWebView",
"Keyframes" to "RCTKeyframes",
"ImpressionTrackingView" to "RCTImpressionTrackingView",
)

/** @return the name of component in the Fabric environment */
@JvmStatic
public fun getFabricComponentName(componentName: String): String =
componentNames.get(componentName) ?: componentName
}

0 comments on commit 77dfa43

Please sign in to comment.