Skip to content

Commit f891c01

Browse files
committed
added custom container style options to touchable
1 parent 4aff509 commit f891c01

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

source/views/components/touchable.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ type PropsType = {
1414
children?: any,
1515
borderless?: boolean,
1616
style?: any,
17+
containerStyle?: any,
1718
}
1819
export const Touchable = ({
1920
children,
2021
style,
2122
highlight = true,
2223
borderless = false,
2324
onPress = () => {},
25+
containerStyle,
2426
...props
2527
}: PropsType) => {
2628
// The child <View> is required; the Touchable needs a View as its direct child.
@@ -34,7 +36,12 @@ export const Touchable = ({
3436
? {underlayColor: '#d9d9d9'}
3537
: {activeOpacity: 0.65}
3638
return (
37-
<Component onPress={onPress} {...innerProps} {...props}>
39+
<Component
40+
onPress={onPress}
41+
{...innerProps}
42+
style={containerStyle}
43+
{...props}
44+
>
3845
{content}
3946
</Component>
4047
)
@@ -48,6 +55,7 @@ export const Touchable = ({
4855
<TouchableNativeFeedback
4956
onPress={onPress}
5057
background={background}
58+
style={containerStyle}
5159
{...props}
5260
>
5361
{content}

0 commit comments

Comments
 (0)