Skip to content

Commit 3838d54

Browse files
authored
remove redundant wrapping view in Button component (#638)
1 parent d193f8a commit 3838d54

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/button/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {Constants} from '../../helpers';
66
import {Colors, Typography, ThemeManager, BorderRadiuses} from '../../style';
77
import {PureBaseComponent} from '../../commons';
88
import TouchableOpacity from '../touchableOpacity';
9-
import View from '../view';
109
import Text from '../text';
1110

1211
const PADDINGS = {
@@ -465,6 +464,8 @@ export default class Button extends PureBaseComponent {
465464

466465
return (
467466
<TouchableOpacity
467+
row
468+
centerV
468469
style={[
469470
this.styles.container,
470471
animateLayout && this.getAnimationDirectionStyle(),
@@ -486,11 +487,9 @@ export default class Button extends PureBaseComponent {
486487
{...others}
487488
ref={this.setRef}
488489
>
489-
<View row centerV>
490-
{this.props.children}
491-
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
492-
{this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
493-
</View>
490+
{this.props.children}
491+
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
492+
{this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
494493
</TouchableOpacity>
495494
);
496495
}

0 commit comments

Comments
 (0)