android - React 原生组件在运行时如何作为 View 、ViewGroup 或 Fragments 运行?

标签 android react-native

In React native we create components as:-

export default class MyComponent extends Component {
 render() {
    return (
      <View >
      </View> 
    )
  }
}

and make a Android build but when its run on android OS then these components will convert into which android component (fragment, View or ViewGroup).

最佳答案

Basically In android Its Invoke A single activity (MainActivity) and inside it a single view ReactRootView rendered something like fragment renders in activity. All React native components render inside single ReactRootView.

了解更多详情:- https://facebook.github.io/react-native/docs/integration-with-existing-apps

关于android - React 原生组件在运行时如何作为 View 、ViewGroup 或 Fragments 运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53626379/

相关文章:

android - 使用 set 方法将数据从 Activity 发送到 Fragment

java - Kotlin 无法获取所需的类型干扰 Array<Uri>!找到数组<Uri?>

javascript - 从字符串转换为数组 react native

react-native - 堆叠顺序 : How to render component so it appears on top of parents' sibling who renders afterwards

javascript - 如何使用 React Native 管理 axios 中的 429 错误?

ios - Xcode 11 升级 |找不到 iPhone X 模拟器 | XRPackageModel 9.0.omo

java - OverridePendingTransition 工作异常

java - 如何确定 Java 中 View 的像素单位(px、dp 等)?

android - InflateException 扩展 android.preference.ListPreference

react-native:如何在离线模式下在模拟器上运行应用程序?