Upload
evan-stone
View
173
Download
0
Embed Size (px)
Citation preview
What’s This React Na.ve Thing I Keep Hearing About?
Evan K. Stone Senior iOS Developer
Cloud City Development // San Francisco
iOS Dev Break Podcast
iOS Dev Break: 15 minutes of current events, 8ps, and advice for iOS Developers!
A mo.va.onal speech about why everyone should drop everything and switch to Javascript and learn a totally new development paradigm
for crea.ng mobile applica.ons
<View style={styles.headerContainer}> <Text style={styles.headerMessage}>Messages</Text> <TextInput style={styles.textInput} onChangeText={(entryText) => this.setState({entryText})} onSubmitEditing={(event) => this.onGoButtonPressed()} placeholder={'Enter Message'} value={this.state.entryText} returnKeyType="go" /> </View>
React Na.ve JavaScript Environment
h`ps://facebook.github.io/react-na.ve/docs/javascript-environment.html
<View style={Style.sceneContainer}> <View style={Style.subNav}> <Text style={Style.subNavText}></Text> </View> <View style={styles.loadingIndicatorContainer}> <View> <ActivityIndicator animating={this.state.animating} color={indicatorColor} size={indicatorSize} /> <Text style={styles.message}>{message}</Text> </View> </View> </View>
<View style={Style.sceneContainer}> <View style={Style.subNav}> <Text style={Style.subNavText}></Text> </View> <View style={styles.loadingIndicatorContainer}> <View> <ActivityIndicator animating={this.state.animating} color={indicatorColor} size={indicatorSize} /> <Text style={styles.message}>{message}</Text> </View> </View> </View>
<View style={Style.sceneContainer}> <View style={Style.subNav}> <Text style={Style.subNavText}></Text> </View> <View style={styles.loadingIndicatorContainer}> <LoadingIndicator containerStyle={styles.loadingIndicator} show={true} /> </View> </View>
AddButton.propTypes = { buttonText: PropTypes.string, onPress: PropTypes.func.isRequired, style: PropTypes.oneOfType([ PropTypes.object, PropTypes.array, PropTypes.number, ]), }
<View style={styles.buttonAlign}> <AddButton style={styles.addButton} buttonText="Add a Message" onPress={() => this.onAddMessageButtonPress()} /> </View>
Fetchh`ps://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
fetchMessages() { const url = 'http://localhost:3000/messages'; fetch(url, { method: 'GET', }) .then((response) => response.json()) .then((json) => { this.setState({ dataSource: this.state.dataSource.cloneWithRows(json) }); }) .catch(error => { console.log(error); Alert.alert( 'Refresh Failed', 'An error occurred while retrieving messages.', [ {text: 'OK'} ] ); }); }
fetchMessages() { const url = 'http://localhost:3000/messages'; fetch(url, { method: 'GET', }) .then((response) => response.json()) .then((json) => { this.setState({ dataSource: this.state.dataSource.cloneWithRows(json) }); }) .catch(error => { console.log(error); Alert.alert( 'Refresh Failed', 'An error occurred while retrieving messages.', [ {text: 'OK'} ] ); }); }
Flexboxh`ps://facebook.github.io/react-na.ve/docs/flexbox.html
React Na.ve Docs h`ps://facebook.github.io/react-na.ve/docs/geing-started.html
Paul Hudson - Going Na.ve with React h`ps://forwardcourses.com/workshops/64
Tim Garcia - React Na.ve: Mobile Apps Without SwiV Free trial at Forward Courses!
Evan K. Stone
web: h<p://www.cloudcity.io
cloud city blog: h<p://blog.cloudcity.io
blog: h<p://www.interac?velogic.net
twi<er: @interac?vlogic
h`p://www.iosdevbreak.com
iOS Dev Break Podcast
Twi`er: @iOSDevBreak
Subscribe on iTunes/Overcast: iOS Dev Break