Caio Sacramento
FISL 17 @ Porto Alegre, 13 de Julho de 2016
http://www.isaacchansky.me/ days-since-last-new-js-framework
ShoppingCartComponent
ShoppingCartComponent
CartListComponent
ShoppingCartComponent
CartListComponent
CartItemComponent
import React, { Component, PropTypes } from 'react';
class Embedly extends Component {
render() {
return (
<div className="embed">
<a id="embedly" href={this.props.url}></a>
</div>
);
}
}
export default Embedly;
Embedly.js
Imutáveis
Mutável
import React, { Component, PropTypes } from 'react';
class Example extends Component {
componentWillMount() {
window.alert('Your component is loading');
}
componentWillReceiveProps: function(nextProps) {
this.setState({
increasing: nextProps.count > this.props.count
});
}
componentDidMount() {
window.alert('Your component is ready');
}
render() {
return (<p>Mounted</p>)
}
}
export default Example;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
<View style={styles.container}>
</View>
https://github.com/caiosba/react-native-css
description {
margin-bottom: 20px;
font-size: 18px;
text-align: center;
color: #656656;
}
container {
padding: 30px;
margin-top: 65px;
align-items: center;
display: block;
}
// style.js
module.exports = require('react-native').StyleSheet.create(
{
"description": {
"marginBottom":20,
"fontSize":18,
"textAlign":"center",
"color":"#656656"
},
"container":{
"padding":30,
"marginTop":65,
"alignItems":"center"
}
}
);
https://www.npmjs.com/package/react-native-share-menu
https://github.com/meedan/generator-keefer
$ cp config.yml.example config.yml
$ npm install -g yo
$ npm link
$ yo keefer
URL via parâmetro
$ PLATFORM=web npm run build
URL via link clicado ou endereço da aba atual
$ PLATFORM=chrome npm run build
URL via menu de compartilhamento
$ PLATFORM=android npm run build
caiosba@gmail.com
slides.com/caiosba/fisl17