React Native 初步
【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 初步的更多相关文章
- react native初步常见问题
首先按照资料一步步搭建环境运行,然后成功了,很激动,可是,安卓就是没这么容易成功,还是太年轻了 could not get batchedbridge, make sure your bundle i ...
- React Native基础&入门教程:初步使用Flexbox布局
在上篇中,笔者分享了部分安装并调试React Native应用过程里的一点经验,如果还没有看过的同学请点击<React Native基础&入门教程:调试React Native应用的一小 ...
- React Native 从入门到原理
React Native 是最近非常火的一个话题,介绍如何利用 React Native 进行开发的文章和书籍多如牛毛,但面向入门水平并介绍它工作原理的文章却寥寥无几. 本文分为两个部分:上半部分用通 ...
- 携程React Native实践
React Native(下文简称 RN)开源已经一年多时间,国内各大互联网公司都在使用,携程也在今年 5 月份投入资源开始引入,并推广给多个业务团队使用,本文将会分享我们遇到的一些问题以及我们的优化 ...
- 关于React Native 火热的话题,从入门到原理
本文授权转载,作者:bestswifter(简书) React Native 是最近非常火的一个话题,介绍如何利用 React Native 进行开发的文章和书籍多如牛毛,但面向入门水平并介绍它工作原 ...
- React Native运行原理解析
Facebook 于2015年9月15日推出react native for Android 版本, 加上2014年底已经开源的IOS版本,至此RN (react-native)真正成为跨平台的客户端 ...
- React Native小白入门学习路径——二
万万没想到,RN组仅剩的一个学长也走了,刚进实验室没几天就被告知这样的事情,一下子还真的有点接受不了,现在RN组就成了为一个没有前辈带的组了,以后学习就更得靠自己了吧.唉,看来得再努力一点了. 这一周 ...
- React Native 从入门到原理一
React Native 从入门到原理一 React Native 是最近非常火的一个话题,介绍如何利用 React Native 进行开发的文章和书籍多如牛毛,但面向入门水平并介绍它工作原理的文章却 ...
- taro之React Native 端开发研究
初步结论:如果想把 React Native 集成到现有的原生项目中,不能使用taro的React Native 端开发功能(目前来说不能实现,以后再观察). RN开发有2种模式: 1.一是原生A ...
随机推荐
- mysql中表里的数据重新设置自增的id的方法
如果删除表数据用这个 TRUNCATE TABLE tablename 如果不删除表 alter table table_name AUTO_INCREMENT=;
- 《算法》第五章部分程序 part 4
▶ 书中第五章部分程序,包括在加上自己补充的代码,Trie 树类,Trie 集合,三值搜索树(Ternary Search Trie) ● Trie 树类 package package01; imp ...
- redisUtils
package com.icil.elsa.subscribe.milestone.common.utils; import java.io.Serializable; import java.uti ...
- Windows下卸载Apache、Mysql
卸载Apache 1. 停止服务 2.以管理员身份打开命令环境 3. 删除Apache文件目录 卸载Mysql 一.在控制面板,卸载MySQL的所有组件控制面板——>所有控制面板项——>程 ...
- sql server 语法 MSDN
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql
- .net DLL 注册 regasm delphi调用
.net DLL 注册 regasm regasm regasm myTest.dll regasm.exe 打开vs2005自带的工具“Visual Studio 2005命令提示”,输入上述命令 ...
- linux 源码编译php的参数
./configure --prefix=/usr/local/php-5.3.5 --with-config-file-path=/usr/local/php-5.3.5/etc --with-co ...
- JEECG 新手常见问题大全,入门必读
大家还有什么问题,请跟帖,谢谢支持.. JEECG常见问题大全 原文地址:http://t.cn/RvYsEF61. jeecg数据库脚本问题 注意:jeecg3.5.2之前版本,不需要数据库脚 ...
- jquery循环方法
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- docker-compose初试及命令基础
转自:https://www.cnblogs.com/jsonhc/p/7811929.html 以一个简单的lnmp.yaml的配置文件进行讲解docker-compose命令的基础讲解,熟练掌握命 ...