React Native 初步

1、Create React Native App is the easiest way to start building a new React Native application. It allows you to start a project without installing or configuring any tools to build native code - no Xcode or Android Studio installation required

  npm install -g create-react-native-app

2、Then run the following commands to create a new React Native project called "AwesomeProject":

  create-react-native-app App

  

  If you want to run your app on the iOS Simulator or an Android Virtual Device, please refer to the instructions for building projects with native code to learn how to install Xcode and set up your Android development environment. 然后按上述命令:

  npm run ios 或 npm run android

  

3、Install the Expo client app on your iOS or Android phone and connect to the same wireless network as your computer. Using the Expo app, scan the QR code from your terminal to open your project.

  Expo下载地址:https://expo.io/tools

4、警告

  1)使用create-react-native-app创建的项目,没有编译任何Native Code,无法添加自定义antive模块。

   只能使用 react-native api以及expo提供的 components。

  2)eject用于将create-react-native-app创建的应用转移成为react-native应用,过程不可逆。

5、拥有独特的 react-native 库

  

6、AppRegistry

  The AppRegistry just tells React Native which component is the root one for the whole application.

// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject', () => HelloWorldApp);

7、Image 的使用

render() {
let pic = {
uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'
};
return (
<Image source={pic} style={{width: 193, height: 110}}/>
);
}

8、View

  A View is useful as a container for other components, to help control style and layout.

<View style={{alignItems: 'center'}}>
<Greeting name='Rexxar' />
<Greeting name='Jaina' />
<Greeting name='Valeera' />
</View>

参考:

http://facebook.github.io/react-native/docs/props.html

React Native 初步的更多相关文章

  1. react native初步常见问题

    首先按照资料一步步搭建环境运行,然后成功了,很激动,可是,安卓就是没这么容易成功,还是太年轻了 could not get batchedbridge, make sure your bundle i ...

  2. React Native基础&入门教程:初步使用Flexbox布局

    在上篇中,笔者分享了部分安装并调试React Native应用过程里的一点经验,如果还没有看过的同学请点击<React Native基础&入门教程:调试React Native应用的一小 ...

  3. React Native 从入门到原理

    React Native 是最近非常火的一个话题,介绍如何利用 React Native 进行开发的文章和书籍多如牛毛,但面向入门水平并介绍它工作原理的文章却寥寥无几. 本文分为两个部分:上半部分用通 ...

  4. 携程React Native实践

    React Native(下文简称 RN)开源已经一年多时间,国内各大互联网公司都在使用,携程也在今年 5 月份投入资源开始引入,并推广给多个业务团队使用,本文将会分享我们遇到的一些问题以及我们的优化 ...

  5. 关于React Native 火热的话题,从入门到原理

    本文授权转载,作者:bestswifter(简书) React Native 是最近非常火的一个话题,介绍如何利用 React Native 进行开发的文章和书籍多如牛毛,但面向入门水平并介绍它工作原 ...

  6. React Native运行原理解析

    Facebook 于2015年9月15日推出react native for Android 版本, 加上2014年底已经开源的IOS版本,至此RN (react-native)真正成为跨平台的客户端 ...

  7. React Native小白入门学习路径——二

    万万没想到,RN组仅剩的一个学长也走了,刚进实验室没几天就被告知这样的事情,一下子还真的有点接受不了,现在RN组就成了为一个没有前辈带的组了,以后学习就更得靠自己了吧.唉,看来得再努力一点了. 这一周 ...

  8. React Native 从入门到原理一

    React Native 从入门到原理一 React Native 是最近非常火的一个话题,介绍如何利用 React Native 进行开发的文章和书籍多如牛毛,但面向入门水平并介绍它工作原理的文章却 ...

  9. taro之React Native 端开发研究

    初步结论:如果想把 React Native 集成到现有的原生项目中,不能使用taro的React Native 端开发功能(目前来说不能实现,以后再观察).   RN开发有2种模式: 1.一是原生A ...

随机推荐

  1. #151: 每一本正式出版的图书都有一个ISBN号码与之对应,ISBN码包括9位数字、1位识别码和3位分隔符,其规定格式如“x-xxx-x

    试题描述 每一本正式出版的图书都有一个ISBN号码与之对应,ISBN码包括9位数字.1位识别码和3位分隔符,其规定格式如“x-xxx-xxxxx-x”,其中符号“-”是分隔符(键盘上的减号),最后一位 ...

  2. django---单表操作之展示书籍列表

    下面使用python console对数据库进行增删改查 下面我们来举个例子在页面上展示记录 结果: 注意html里面变量的写法 {% for book in book_list %} <tr& ...

  3. LeetCode 6. ZigZag Conversion & 字符串

    ZigZag Conversion 看了三遍题目才懂,都有点怀疑自己是不是够聪明... 就是排成这个样子啦,然后从左往右逐行读取返回. 这题看起来很简单,做起来,应该也很简单. 通过位置计算行数: P ...

  4. hive之窗口函数

    窗口函数 1.相关函数说明 COVER():指定分析函数工作的数据窗口大小,这个数据窗口大小可能会随着行的变而变化 CURRENT ROW:当前行 n PRECEDING:往前n行数据 n FOLLO ...

  5. Getting started with C# and GDAL

    Getting started with C# and GDAL http://vipassanaandenvironmentalinformatics.blogspot.jp/2013/03/get ...

  6. [Writeup]奇怪的单点音

    [Writeup]奇怪的单点音 单点音韵律,感觉法继续 看题 一个wav文件,没啥好说的 听了一下,类似鸟叫的电子音,后面插了不规律的三次嘟嘟声 先排除摩斯电码吧(唯一知道的东西(σ゚∀゚)σ) 解法 ...

  7. 根据svm将视频帧转换为img

    # -*- coding: utf-8 -*- """ Created on Mon Oct 1 09:32:37 2018 @author: Manuel " ...

  8. java byte[]与十六进制字符串相互转换

    http://blog.csdn.net/worm0527/article/details/69939307 http://blog.csdn.net/androiddeveloper_lee/art ...

  9. Shell编程:小白初步

    shell类型: shell的历史网络上有一大堆,这里就不介绍了.但是我们的Linux系统上是有许多种shell的我们可以查看:使用命令 vi /etc/passwd 可以查看用户对应的shell(其 ...

  10. Haskell语言学习笔记(75)Conduit

    安装 conduit $ cabal install conduit Installed conduit-1.3.0.3 Prelude> import Conduit Prelude Cond ...