Skip to content

Commit

Permalink
Fix TouchableNativeFeedback regression (#3294)
Browse files Browse the repository at this point in the history
## Description

#3260 introduced a regression to the `Gesture Handlers`'s
`TouchableNativeFeedback` component.
The component used to be a direct reference to the
`TouchableNativeFeedback`, which has a [couple of static
methods](https://reactnative.dev/docs/touchablenativefeedback#methods).
When it was replaced with a function component, the static methods got
removed, leaving only the render function of the
`TouchableNativeFeedback`.

## Test plan

See how the type errors in the
`example/src/release_tests/touchables/index.tsx` are resolved.
  • Loading branch information
latekvo authored Dec 19, 2024
1 parent 5752e01 commit 18c39b2
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/components/touchables/TouchableNativeFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
import React, { useEffect } from 'react';
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';
import { tagMessage } from '../../utils';

/**
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
*/
const TouchableNativeFeedback: React.FC<
React.ComponentProps<typeof RNTouchableNativeFeedback>
> = (props) => {
useEffect(() => {
console.warn(
tagMessage(
'TouchableOpacity component will be removed in the future version of Gesture Handler.'
)
);
}, []);

return <RNTouchableNativeFeedback {...props} />;
};
const TouchableNativeFeedback = RNTouchableNativeFeedback;

export default TouchableNativeFeedback;

0 comments on commit 18c39b2

Please sign in to comment.