Skip to content

Commit d1a9c08

Browse files
nbolenderide
authored andcommitted
Add childGroupStyle prop to allow customizing the container of multiple children (e.g. to change the justifyContent property) (#72)
1 parent 32e2403 commit d1a9c08

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Button.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default class Button extends Component {
2222
disabled: PropTypes.bool,
2323
style: Text.propTypes.style,
2424
styleDisabled: Text.propTypes.style,
25+
childGroupStyle: ViewPropTypes.style,
2526
};
2627

2728
render() {
@@ -64,6 +65,10 @@ export default class Button extends Component {
6465
this.props.style,
6566
disabled ? this.props.styleDisabled : null,
6667
];
68+
let childGroupStyle = [
69+
styles.group,
70+
this.props.childGroupStyle,
71+
];
6772

6873
let children = coalesceNonElementChildren(this.props.children, (children, index) => {
6974
return (
@@ -79,7 +84,7 @@ export default class Button extends Component {
7984
case 1:
8085
return children[0];
8186
default:
82-
return <View style={styles.group}>{children}</View>;
87+
return <View style={childGroupStyle}>{children}</View>;
8388
}
8489
}
8590

0 commit comments

Comments
 (0)