├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── LICENSE ├── README.md ├── assets ├── codes │ ├── Navigator.example │ ├── StyleSheet.example │ ├── TextComponent.example │ ├── ViewComponent.example │ ├── index.ios.example │ ├── install-cli.example │ ├── new-project.example │ ├── registerComponent.example │ └── render-error.example ├── console.png ├── ctlin.jpg ├── devopts.png ├── github.png ├── npm.png ├── pause-on-error.png ├── react-native.png ├── redbox.png ├── rnplay-app.png └── rnplay.png ├── dist ├── 044b5116eb37c9646d7af104e2b4a834.jpg ├── 22767c4764c73afe41531e1bbed0bed2.png ├── 2df1b77d88ad45e14d51ac9ba5af6491.png ├── 4a5b9702548f231c568f052c8aa0f62b.png ├── 55f75f45b5a488bae440683209f9d716.png ├── 6378c42d8eeaa6d663d07d751f1b78e9.png ├── 7175bd83418c8fc21447c15a814a6196.png ├── 79709c47d5c8fbbc8167d5f5177ad4b1.png ├── bundle.js ├── d44a65d6f98297835195ffe28de7eb97.png └── f6e32475142df0da7aae63a1842a2e6c.png ├── index.html ├── index.js ├── package.json ├── presentation └── index.js ├── server.js ├── webpack.config.js └── webpack.config.production.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "react", "stage-0"], 3 | "env": { 4 | "development": { 5 | "presets": ["react-hmre"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*.example] 10 | insert_final_newline = false 11 | 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | --- 2 | "extends": 3 | - "eslint-config-defaults/configurations/walmart/es6-react" 4 | 5 | "rules": 6 | "indent": [2, 2, {"SwitchCase": 1}] 7 | "max-len": 0 8 | 9 | "env": 10 | "browser": true, 11 | "node": true 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | npm-debug.log 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-intro 2 | 3 | [https://chentsulin.github.io/react-native-intro](https://chentsulin.github.io/react-native-intro) 4 | -------------------------------------------------------------------------------- /assets/codes/Navigator.example: -------------------------------------------------------------------------------- 1 | 4 | { 7 | var nextIndex = route.index + 1; 8 | navigator.push({ 9 | name: 'Scene ' + nextIndex, 10 | index: nextIndex, 11 | }); 12 | }} 13 | onBack={() => { 14 | if (route.index > 0) { 15 | navigator.pop(); 16 | } 17 | }} 18 | /> 19 | } 20 | /> -------------------------------------------------------------------------------- /assets/codes/StyleSheet.example: -------------------------------------------------------------------------------- 1 | const styles = StyleSheet.create({ 2 | base: { 3 | width: 38, 4 | height: 38, 5 | }, 6 | background: { 7 | backgroundColor: '#222222', 8 | }, 9 | active: { 10 | borderWidth: 2, 11 | borderColor: '#00ff00', 12 | }, 13 | }); 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /assets/codes/TextComponent.example: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { AppRegistry, Text } from 'react-native'; 3 | 4 | const App = () => ( 5 | Hello World! 6 | ); 7 | 8 | AppRegistry.registerComponent('MyApp', () => App); -------------------------------------------------------------------------------- /assets/codes/ViewComponent.example: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { AppRegistry, Text, View } from 'react-native'; 3 | 4 | const App = () => ( 5 | 6 | Hello! 7 | 8 | ); 9 | 10 | AppRegistry.registerComponent('MyApp', () => App); -------------------------------------------------------------------------------- /assets/codes/index.ios.example: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | class AwesomeApp extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.ios.js 24 | 25 | 26 | Press Cmd+R to reload,{'\n'} 27 | Cmd+D or shake for dev menu 28 | 29 | 30 | ); 31 | } 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | container: { 36 | flex: 1, 37 | justifyContent: 'center', 38 | alignItems: 'center', 39 | backgroundColor: '#F5FCFF', 40 | }, 41 | welcome: { 42 | fontSize: 20, 43 | textAlign: 'center', 44 | margin: 10, 45 | }, 46 | instructions: { 47 | textAlign: 'center', 48 | color: '#333333', 49 | marginBottom: 5, 50 | }, 51 | }); 52 | 53 | AppRegistry.registerComponent('AwesomeApp', () => AwesomeApp); -------------------------------------------------------------------------------- /assets/codes/install-cli.example: -------------------------------------------------------------------------------- 1 | npm install -g react-native-cli -------------------------------------------------------------------------------- /assets/codes/new-project.example: -------------------------------------------------------------------------------- 1 | react-native init AwesomeProject 2 | cd AwesomeProject 3 | 4 | /* Run iOS */ 5 | react-native run-ios 6 | 7 | /* Run Android */ 8 | emulator -avd [your_emulator_name] -gpu on & 9 | react-native run-android -------------------------------------------------------------------------------- /assets/codes/registerComponent.example: -------------------------------------------------------------------------------- 1 | AppRegistry.registerComponent('AwesomeApp', () => AwesomeApp); -------------------------------------------------------------------------------- /assets/codes/render-error.example: -------------------------------------------------------------------------------- 1 | render() { 2 | throw new Error('boom..'); 3 | return ( 4 | 5 | 6 | Welcome to React Native! 7 | 8 | 9 | ); 10 | } -------------------------------------------------------------------------------- /assets/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/console.png -------------------------------------------------------------------------------- /assets/ctlin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/ctlin.jpg -------------------------------------------------------------------------------- /assets/devopts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/devopts.png -------------------------------------------------------------------------------- /assets/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/github.png -------------------------------------------------------------------------------- /assets/npm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/npm.png -------------------------------------------------------------------------------- /assets/pause-on-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/pause-on-error.png -------------------------------------------------------------------------------- /assets/react-native.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/react-native.png -------------------------------------------------------------------------------- /assets/redbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/redbox.png -------------------------------------------------------------------------------- /assets/rnplay-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/rnplay-app.png -------------------------------------------------------------------------------- /assets/rnplay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/assets/rnplay.png -------------------------------------------------------------------------------- /dist/044b5116eb37c9646d7af104e2b4a834.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/044b5116eb37c9646d7af104e2b4a834.jpg -------------------------------------------------------------------------------- /dist/22767c4764c73afe41531e1bbed0bed2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/22767c4764c73afe41531e1bbed0bed2.png -------------------------------------------------------------------------------- /dist/2df1b77d88ad45e14d51ac9ba5af6491.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/2df1b77d88ad45e14d51ac9ba5af6491.png -------------------------------------------------------------------------------- /dist/4a5b9702548f231c568f052c8aa0f62b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/4a5b9702548f231c568f052c8aa0f62b.png -------------------------------------------------------------------------------- /dist/55f75f45b5a488bae440683209f9d716.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/55f75f45b5a488bae440683209f9d716.png -------------------------------------------------------------------------------- /dist/6378c42d8eeaa6d663d07d751f1b78e9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/6378c42d8eeaa6d663d07d751f1b78e9.png -------------------------------------------------------------------------------- /dist/7175bd83418c8fc21447c15a814a6196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/7175bd83418c8fc21447c15a814a6196.png -------------------------------------------------------------------------------- /dist/79709c47d5c8fbbc8167d5f5177ad4b1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/79709c47d5c8fbbc8167d5f5177ad4b1.png -------------------------------------------------------------------------------- /dist/d44a65d6f98297835195ffe28de7eb97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/d44a65d6f98297835195ffe28de7eb97.png -------------------------------------------------------------------------------- /dist/f6e32475142df0da7aae63a1842a2e6c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chentsulin/react-native-intro/28199a715412c7c8d9c55891430e63de5816da42/dist/f6e32475142df0da7aae63a1842a2e6c.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React Native Intro @ chentsulin 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { render } from "react-dom"; 3 | 4 | import Presentation from "./presentation"; 5 | 6 | render(, document.getElementById("root")); 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-intro", 3 | "version": "1.0.1", 4 | "description": "An introduction to react native", 5 | "main": "lib/index.js", 6 | "scripts": { 7 | "clean": "rimraf dist", 8 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.production.js", 9 | "lint": "eslint --ext .js,.jsx .", 10 | "deploy": "npm run clean & npm run build && git add --all && git commit -nm 'deploy' && git push origin gh-pages", 11 | "start": "cross-env NODE_ENV=development node server.js" 12 | }, 13 | "author": "", 14 | "license": "MIT", 15 | "dependencies": { 16 | "normalize.css": "3.0.3", 17 | "react": "^0.14.3", 18 | "react-dom": "^0.14.3", 19 | "spectacle": "^1.0.4", 20 | "spectacle-code-slide": "^0.1.10" 21 | }, 22 | "devDependencies": { 23 | "autoprefixer-core": "^6.0.1", 24 | "babel-core": "^6.4.0", 25 | "babel-eslint": "^5.0.0-beta6", 26 | "babel-loader": "^6.2.1", 27 | "babel-plugin-react-transform": "^2.0.2", 28 | "babel-polyfill": "^6.3.14", 29 | "babel-preset-es2015": "^6.3.13", 30 | "babel-preset-react": "^6.3.13", 31 | "babel-preset-react-hmre": "^1.0.1", 32 | "babel-preset-stage-0": "^6.3.13", 33 | "cross-env": "^1.0.7", 34 | "css-loader": "^0.23.0", 35 | "eslint": "^1.8.0", 36 | "eslint-config-defaults": "^7.1.1", 37 | "eslint-plugin-filenames": "^0.1.2", 38 | "eslint-plugin-react": "^3.6.3", 39 | "express": "^4.13.3", 40 | "file-loader": "^0.8.4", 41 | "html-loader": "^0.4.0", 42 | "is-buffer": "^1.1.1", 43 | "markdown-loader": "^0.1.7", 44 | "node-libs-browser": "^0.5.3", 45 | "raw-loader": "^0.5.1", 46 | "react-transform-hmr": "^1.0.4", 47 | "rimraf": "^2.4.4", 48 | "style-loader": "^0.13.0", 49 | "surge": "latest", 50 | "url-loader": "^0.5.6", 51 | "webpack": "^1.12.8", 52 | "webpack-dev-middleware": "^1.2.0", 53 | "webpack-hot-middleware": "^2.5.0" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /presentation/index.js: -------------------------------------------------------------------------------- 1 | // Import React 2 | import React from "react"; 3 | 4 | // Import Spectacle Core tags 5 | import { 6 | Appear, 7 | CodePane, 8 | Deck, 9 | Fill, 10 | Heading, 11 | Image, 12 | Layout, 13 | Link, 14 | ListItem, 15 | List, 16 | Slide, 17 | Spectacle, 18 | Text 19 | } from "spectacle"; 20 | 21 | import CodeSlide from "spectacle-code-slide"; 22 | 23 | // Import image preloader util 24 | import preloader from "spectacle/lib/utils/preloader"; 25 | 26 | // Import theme 27 | import createTheme from "spectacle/lib/themes/default"; 28 | 29 | // Require CSS 30 | require("normalize.css"); 31 | require("spectacle/lib/themes/default/index.css"); 32 | 33 | 34 | const images = { 35 | ctlin: require("../assets/ctlin.jpg"), 36 | reactNative: require("../assets/react-native.png"), 37 | reactNativeGithub: require("../assets/github.png"), 38 | reactNativeNpm: require("../assets/npm.png"), 39 | redbox: require("../assets/redbox.png"), 40 | devOptions: require("../assets/devopts.png"), 41 | console: require("../assets/console.png"), 42 | pauseOnError: require("../assets/pause-on-error.png"), 43 | rnplay: require("../assets/rnplay.png"), 44 | rnplayApp: require("../assets/rnplay-app.png") 45 | }; 46 | 47 | preloader(images); 48 | 49 | const theme = createTheme({ 50 | primary: "#ea6143" 51 | }); 52 | 53 | export default class Presentation extends React.Component { 54 | render() { 55 | return ( 56 | 57 | 58 | 59 | 60 | React Native 61 | 62 | 63 | Intro 64 | 65 | @chentsulin 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | C. T. Lin 75 | Full Stack JS Architect@Yoctol 76 | 77 | 78 | 79 | Node, React, GraphQL.. 80 | 81 | 82 | chentsulin@github 83 | 84 | 85 | chentsulin@twitter 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | Release 94 | 95 | 96 | 97 | 98 | iOS
2015/01 99 |
100 |
101 |
102 | 103 | 104 | 105 | Android
2015/09 106 |
107 |
108 |
109 |
110 | 111 | Now - 0.28.0 112 | 113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | Who use React Native? 123 | 124 | 125 | Facebook Groups 126 | Facebook Ads Manager 127 | F8 128 | React Native Playground 129 | li.st 130 | 131 | 132 | 133 | 134 | Show Case 135 | 136 | 137 | 138 | Setup 139 | 140 | 141 | 142 | iOS 143 | 144 | 145 | Xcode >= 7 146 | 147 | 148 | 149 | 150 | Android 151 | 152 | 153 | AVD (Android Virtual Device) 154 | Android Studio 155 | $ANDROID_HOME 156 | 157 | 158 | 159 | See {" "} 160 | 161 | docs - Getting Started 162 | 163 | 164 | 165 | 173 | 184 | 185 | Files 186 | 187 | 188 | 189 | iOS 190 | 191 | 192 | ios/ 193 | index.ios.js 194 | 195 | 196 | 197 | 198 | Android 199 | 200 | 201 | android/ 202 | index.android.js 203 | 204 | 205 | 206 | 207 | 219 | 220 | 221 | Style in React Native 222 | 223 | 224 | 225 | CSS in JS (by vjeux) 226 | 227 | 228 | Flexbox 229 | 230 | 231 | Implemented via css-layout 232 | 233 | style props accept array 234 | style props accept falsy values 235 | docs 236 | 237 | 238 | 239 | 240 | StyleSheet 241 | 242 | 248 | 249 | 250 | 251 | Register App using AppRegistry.registerComponent 252 | 253 | 259 | 260 | 261 | 262 | Text Component 263 | 264 | 270 | 271 | 272 | 273 | View Component 274 | (just like div, UIView) 275 | 276 | 282 | 283 | 284 | 285 | Debugging 286 | 287 | 288 | 289 | 290 | When error thrown... 291 | 292 | 298 | 299 | 300 | 301 | Red Box 302 | 303 | 304 | 305 | 306 | 307 | Keymaps 308 | 309 | 310 | Cmd+R - Reload 311 | Cmd+D - Toggle development options 312 | Cmd+Ctrl+Z - Shaking device 313 | 314 | 315 | 316 | 317 | Development Options 318 | 319 | 320 | 321 | 322 | 323 | Remote JS Debugging (chrome v8) 324 | 325 | 326 | open http://localhost:8081/debugger-ui 327 | can print something to console 328 | can see thrown errors 329 | can pause on exceptions 330 | 331 | 332 | 333 | 334 | Debugging Console 335 | 336 | 337 | 338 | 339 | 340 | Pause on Exceptions 341 | 342 | 343 | 344 | 345 | 346 | Other bulit-in Components 347 | 348 | 349 | 350 |