More Related Content
More from Robin Pokorny (8)
React a CSS
- 5. render: function() {
var classString = 'line';
if (this.props.isFamous) {
classString += ' line--famous';
}
return <div className={classString}>
O válce zpívám a reku…
</div>;
}
- 6. render: function() {
var classString = 'line';
if (this.state.isSelected) {
classString += ' line--selected';
}
return <div className={classString}>
O válce zpívám a reku…
</div>;
}
- 7. render: function() {
var cx = React.addons.classSet;
var classes = cx({
'line': true,
‘message--famous':
this.props.isFamous
});
return <div className={classes}>
O válce zpívám a reku…
</div>;
}
- 9. 1. Global Namespace
2. Dependencies
3. Dead Code Elimination
4. Minification
5. Sharing Constants
6. Non-deterministic Resolution
7. Isolation
- 12. var styles = {
line: {
marginTop: 20,
color: '#999',
},
famous: {
backgroundColor: 'bisque',
}
}
- 13. var styles = {
line: {
marginTop: 20,
color: '#999',
},
famous: {
backgroundColor: 'bisque',
}
}
return <div style={styles.line}>
O válce zpívám a reku…
</div>;
- 16. 1. Global Namespace
2. Dependencies
3. Dead Code Elimination
4. Minification
5. Sharing Constants
6. Non-deterministic Resolution
7. Isolation
- 21. var ResizeMixin = {
componentDidMount: function() {
this.resizeListener =
window.addEventListener(
'resize',
this.forceUpdate.bind(this)
);
},
componentWillUnmount: function() {
window.removeEventListener('resize',
this.resizeListener);
}
};