Top Banner
React & apps MAKE WEB NOT WAR
17

React for WinRT apps

Dec 22, 2015

Download

Documents

Victor Iatco

Presentation from JS Lab: React for WinRT and WinPhone applications
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: React for WinRT apps

React & appsMAKE WEB NOT WAR

Page 2: React for WinRT apps

React in Web

Page 3: React for WinRT apps

JSX / Virtual DOM

Page 4: React for WinRT apps

React in Web

Page 5: React for WinRT apps

React Native

Page 6: React for WinRT apps

React Native (iOS + Android)

Page 7: React for WinRT apps

React Native

Page 8: React for WinRT apps

React Native Components (iOS)ActivityIndicatorIOS

DatePickerIOS

Image

ListView

MapView

Navigator

NavigatorIOS

PickerIOS

ScrollView

SliderIOS

SwitchIOS

TabBarIOS

Text

TextInput

TouchableHighlight

TouchableOpacity

TouchableWithoutFeedback

View

WebView

Page 9: React for WinRT apps

React Native Styling var styles = StyleSheet.create({

base: { width: 38, height: 38 },

background: { backgroundColor: '#222222' },

active: { borderWidth: 2, borderColor: '#00ff00' },

});

<Text style={styles.base} />

<View style={styles.background} />

Page 10: React for WinRT apps

JS apps: “native” vs native

Page 11: React for WinRT apps
Page 12: React for WinRT apps

WinJS <div id="createAppBar" data-win-control="WinJS.UI.AppBar" data-win-options="{placement:'bottom'}">

<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdAdd',label:'Add',icon:'add',tooltip:'Add item',section:'primary',type:'flyout',flyout:select('#addFlyout'),onclick:Sample.outputCommand}"></button>

<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdRemove',label:'Remove',icon:'remove',tooltip:'Remove item',section:'primary',onclick:Sample.outputCommand}"></button>

<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdEdit',label:'Edit',icon:'edit',tooltip:'Edit item',section:'primary',onclick:Sample.outputCommand}"></button>

</div>

Page 13: React for WinRT apps

JSX+WinJS<AppBar id="createAppBar" placement="bottom">{

['Add', 'Remove', 'Edit'].map(name => <AppBarCommand

id={'cmd' + name}

label={name}

icon={name.toLowerCase()}

tooltip={name + ' item'}

section="primary"

onclick={Sample.outputCommand}

/>)

</AppBar>

Page 14: React for WinRT apps

WinJS (function () {

var Robot = WinJS.Class.define(function (name) {

this.name = name;

});

WinJS.Namespace.define("Robotics", { Robot: Robot });

})();

<script src="./robot.js"></script>

var myRobot = new Robotics.Robot("Sam");

Page 15: React for WinRT apps

ES6 export default class Robot {

constructor(name) {

this.name = name;

}

}

...

import Robot from './robot';

var myRobot = new Robotics.Robot("Sam");

Page 16: React for WinRT apps

Hot reload (Webpack+React)

Page 17: React for WinRT apps

Showtime