Skip to content

Commit a842d97

Browse files
committed
Reanimated 2.4 - fix error in Incubator.TouchableOpacity (#1831)
Error: Interpolation input and output should contain at least two values. (cherry picked from commit c8b03e1)
1 parent 246e512 commit a842d97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/incubator/TouchableOpacity.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Reanimated, {
1212
import {TapGestureHandler, LongPressGestureHandler, State} from 'react-native-gesture-handler';
1313
import {asBaseComponent, forwardRef, BaseComponentInjectedProps, ForwardRefInjectedProps} from '../commons/new';
1414
import View, {ViewProps} from '../components/view';
15+
import {Colors} from '../../src/style';
1516

1617
export type TouchableOpacityProps = {
1718
/**
@@ -85,7 +86,7 @@ function TouchableOpacity(props: Props) {
8586
const isLongPressed = useSharedValue(false);
8687

8788
const backgroundColor = useMemo(() => {
88-
return props.backgroundColor || modifiers.backgroundColor;
89+
return props.backgroundColor || modifiers.backgroundColor || Colors.transparent;
8990
}, [props.backgroundColor, modifiers.backgroundColor]);
9091

9192
const onPress = useCallback(() => {
@@ -164,7 +165,7 @@ function TouchableOpacity(props: Props) {
164165
paddings,
165166
margins,
166167
alignments,
167-
backgroundColor && {backgroundColor},
168+
{backgroundColor},
168169
style,
169170
animatedStyle
170171
]}

0 commit comments

Comments
 (0)