React 笔记

create-react-app

React 中文文档

1
2
3
4
5
# create-react-app
yarn global add create-react-app
create-react-app my-app
cd my-app/
npm start

python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
手动安装 python2.7 或 yarn global add --production windows-build-tools
yarn global add node-gyp
npm config set python python2.7
npm config set msvs_version 2015

# 添加环境变量
PYTHON
C:\Python27\python.exe

# path
C:\Python27\
C:\Python27\Scripts

React Native

React Native 中文文档

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
yarn global add react-native-cli
react-native init rn_demo --version 0.59.9
react-native init rn_rematch_demo --template with-rematccode 
react-native init rn_redux_demo --template rematch-redux
react-native run-android

# To run your app on iOS:
cd D:\WWW\567\a567
react-native run-ios
- or -
Open ios\a567.xcodeproj in Xcode
Hit the Run button

# To run your app on Android:
cd D:\WWW\567\a567
Have an Android emulator running (quickest way to get started), or a device connected
react-native run-android

# 模拟器弹出调试菜单
adb shell input keyevent 82

yarn add react-native-gesture-handler
react-native link react-native-gesture-handler

dva

官方文档

1
2
3
4
yarn global add dva-cli
dva new dva-quickstart
cd dva-quickstart
npm start

umi

官方文档

1
2
3
yarn global add umi
mkdir myapp && cd myapp
yarn create umi

react-native-ui-lib

官方文档

1
2
3
4
const FLEX_KEY_PATTERN = /^flex(G|S)?(-\d*)?$/;
const PADDING_KEY_PATTERN = new RegExp(`padding[LTRBHV]?-([0-9]*|${Spacings.getKeysPattern()})`);
const MARGIN_KEY_PATTERN = new RegExp(`margin[LTRBHV]?-([0-9]*|${Spacings.getKeysPattern()})`);
const ALIGNMENT_KEY_PATTERN = /(left|top|right|bottom|center|centerV|centerH|spread)/;

react-devtools

1
2
yarn global add react-devtools
react-devtools

expo

官方文档

1
2
3
4
5
6
7
8
https://github.com/mcnamee/react-native-starter-kit.git
yarn global add expo-cli
expo init expo-demo
cd expo-demo
expo start
expo build:android
expo build:status
expo doctor

Ignite

官方文档

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
yarn global add ignite-cli
ignite new PizzaApp
  ( Choose Andross when prompted )
cd PizzaApp
ignite add maps
ignite add vector-icons
ignite generate screen PizzaLocationList
ignite generate component PizzaLocation
ignite generate map StoreLocator
ignite add i18n
ignite remove i18n
ignite --help

gatsby

官方文档

1
2
3
4
yarn global add gatsby-cli
gatsby new gatsby-site
cd gatsby-site
yarn run develop

taro

官方文档

1
2
3
4
yarn global add @tarojs/cli@1.3.0-beta.6
taro init ..
react-devtools
react-native run-android