React native basic concept and basic understanding

Source: Internet
Author: User

  
然后还包括和一些依赖(什么是依赖?就比如说你使用jquery就要下载这个jquery.js一样,这个被称为依赖)和原生的ios项目工程文件夹
和原生的的Android原生文件夹,当然我们的编辑在index.ios.js(Android)等(一般情况下不需要动原生的项目工程)。
ok!下面我们开始进入index.ios.js文件
首先:我们引入react模块(相当于各种组件的集合以及其他东东)
Import react,{component}from ' React ';

  

然后是引入当前文件所要使用的组件
Import {  Navigatorios,   appregistry,   StyleSheet,   View} from ' react-native ';
其实,这只是一个语法糖而已,比如AppRegistry我们可以这样定义:var AppRegistry = React.AppRegistry;

 Then you define a component as the interface

 构建组件入口。里面的render方法就是渲染视图用的。return返回的是视图的模板代码。其实这是JSX的模板语法,
组件定义好了就可以给组件添加相应的样式,采用
var xxx=stylesheet.create ({...})

Then be quoted:

<view style={{}}></view> <view style={xxx.name}></view>

Well, the code for an initialized interface is basically the same, and then you can develop it.

But before development we have to have a basic foundation:

node. JS Foundation (ES6)

JSX Grammar Basics

Flexbox layout

Iii. documents currently in need of attention
1、目前阶段有几个文件时需要注意下的:(1)在xcode项目代码中AppDelegate.m会标识入口文件,例如:(服务器)jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];如果是网上下载别人的源码,注意此处的ip和端口是否有被修改。(2)闪屏界面在哪修改?在xcode项目中找到LaunchScreen.xib文件,点击,你会看到界面,这个就是启动界面,你手动添加组件或者修改文本即可,最好了解下xcode的使用。(3)文本编辑器打开index.ios.js文件,是js代码的入口文件,所有的代码编写从这开始,可以定义自己的模块和引入第三方模块。
四:其他:
 <Image style={styles.pic} source={{uri: ‘https://avatars3.githubusercontent.com/u/6133685?v=3&s=460‘}}>
其中,Image标签的source的第一个大括号是模板,第二个大括号是js对象,js对象里面有个key是uri,表示图片的地址。
 
 
 

React native basic concept and basic understanding

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.