Skip to content

Commit 8a7aab0

Browse files
authored
TouchableOpacity - fix style's type (#1767)
1 parent a8154b1 commit 8a7aab0

File tree

2 files changed

+6
-10
lines changed
  • generatedTypes/src/components/touchableOpacity
  • src/components/touchableOpacity

2 files changed

+6
-10
lines changed

generatedTypes/src/components/touchableOpacity/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
2-
import { TouchableOpacityProps as RNTouchableOpacityProps, StyleProp, ViewStyle, Animated } from 'react-native';
2+
import { TouchableOpacityProps as RNTouchableOpacityProps } from 'react-native';
33
import { ContainerModifiers } from '../../commons/new';
4+
import { ViewProps } from '../view';
45
export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'style' | 'onPress'>, ContainerModifiers {
56
/**
67
* background color for TouchableOpacity
@@ -29,7 +30,7 @@ export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'st
2930
* Custom value of any type to pass on to TouchableOpacity and receive back in onPress callback
3031
*/
3132
customValue?: any;
32-
style?: StyleProp<ViewStyle> | Animated.AnimatedProps<StyleProp<ViewStyle>>;
33+
style?: ViewProps['style'];
3334
onPress?: (props?: TouchableOpacityProps | any) => void;
3435
}
3536
declare const _default: React.ComponentClass<TouchableOpacityProps & {

src/components/touchableOpacity/index.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import _ from 'lodash';
22
import React, {PureComponent} from 'react';
3-
import {
4-
TouchableOpacity as RNTouchableOpacity,
5-
TouchableOpacityProps as RNTouchableOpacityProps,
6-
StyleProp,
7-
ViewStyle,
8-
Animated
9-
} from 'react-native';
3+
import {TouchableOpacity as RNTouchableOpacity, TouchableOpacityProps as RNTouchableOpacityProps} from 'react-native';
104
import {
115
asBaseComponent,
126
forwardRef,
@@ -15,6 +9,7 @@ import {
159
ContainerModifiers
1610
} from '../../commons/new';
1711
import IncubatorTouchableOpacity from '../../incubator/TouchableOpacity';
12+
import {ViewProps} from '../view';
1813

1914

2015
export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'style' | 'onPress'>,
@@ -43,7 +38,7 @@ export interface TouchableOpacityProps extends Omit<RNTouchableOpacityProps, 'st
4338
* Custom value of any type to pass on to TouchableOpacity and receive back in onPress callback
4439
*/
4540
customValue?: any;
46-
style?: StyleProp<ViewStyle> | Animated.AnimatedProps<StyleProp<ViewStyle>>;
41+
style?: ViewProps['style'];
4742
onPress?: (props?: TouchableOpacityProps | any) => void;
4843
}
4944

0 commit comments

Comments
 (0)