This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution #1: Generic Override (like CSS) | |
var ButtonGroup = React.createClass({ | |
render() { | |
return <div>{this.props.buttons.map((btn, i) => | |
<Button style={{ | |
...(i !== 0 && {marginLeft: 0}) | |
...(i !== this.props.buttons.length - 1 && {marginRight: 0}) | |
}} /> | |
)}</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require.requireActual('react') | |
var assign = require.requireActual('object-assign') | |
function stubContext(Component, context) { | |
var _component = Component | |
var _context = context | |
var _contextTypes = {} | |
Object.keys(_context).forEach((key) => { | |
_contextTypes[key] = React.PropTypes.any |
NewerOlder