- GitHub Staff
React Native unsupported features:
- No Carthage support: facebook/react-native#13835
- Swift supported is limited:
react-native init
andreact-native link
doesn't work with Swift - Watchman doesn't support symlink: facebook/watchman#105
Known issue of yarn with private npm packages:
- Support for private packages: yarnpkg/yarn#521
- es6-features by @rse: https://github.com/rse/es6-features
- es6-features by @lukehoban: https://github.com/lukehoban/es6features
- Exploring ES6: http://exploringjs.com/es6/index.html
- 阮一峰 "ECMAScript 6入门": http://es6.ruanyifeng.com/#docs/reference
- Generator
try-finally
prevents termination fromreturn
- The return value of the generator function is the value that was queued prior to entering the finally clause.
Example adapted from Exploring ES6: Generators. The following two ways are equivalent.
- Invoke
.return()
on generators:
If you are iterating through an iterator, using a for ... of
loop or something like Array.from
, the return value is going to be ignored. In other words, the value included in the end-of-iteration object (whose property done
is true
) is ignored.
function *gen(){
const val = yield 4;
return val * 2;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
bintray { | |
user = bintrayUser | |
key = bintrayKey | |
configurations = ['archives'] | |
publish = true | |
pkg { | |
repo = bintrayRepo | |
name = "your-package-name" |
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
(adapted from this stackoverflow question)
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle --assets-dest ios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to Parse Parameters in Bash | |
# usage: ./foobar.sh --parameter1=value1 --parameter2=value2 --parameter3=value3 | |
# foobar.sh script | |
while [ "$1" != "" ]; do | |
PARAM=`echo $1 | awk -F= '{print $1}'` # -F tells awk to use "=" (equal sign) as field separator. '{print $1}' takes the first one. | |
VALUE=`echo $1 | awk -F= '{print $2}'` # -F tells awk to use "=" (equal sign) as field separator. '{print $2}' takes the second one. | |
case $PARAM in | |
--parameter1) value1=$VALUE ;; | |
--parameter2) value2=$VALUE ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React from 'react'; | |
import { | |
AppRegistry, | |
Text, |