1.初识React-Native项目 'use strict'//使用严格模式 import React,{ Component } from 'react';//导入React的Component组件 import { AppRegistry,StyleSheet,Text,View } from 'react-native';//导入View Text AppRegistry等类 export default class Day0718 extends Component{ render(){ return( <View> <Text > Welcome to React Native! </Text> </View> ); } } //render 渲染一个View AppRegistry.registerComponent('Day0718',() => Day0718); 在app 下面的MainActivity 中 package com.day0718; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "Day0718"; } } 通过ComponentName 来绑定模块到原生Activity 中
---------------欢迎各位大神加群
----------------Android交流群:230274309
-----------------------------期待大神们的到来
------------------------一---起分享,一起进步!需要你们