Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TouchableNativeFeedback regression #3294

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/src/release_tests/touchables/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Touchables = {
color?: string;
renderChild: (() => null) | ((color?: string) => React.ReactNode);
text: string;
background?: (A: typeof TouchableNativeFeedback) => BackgroundPropType;
background?: (A: typeof RNTouchableNativeFeedback) => BackgroundPropType;
};

const TOUCHABLES: Touchables[] = [
Expand Down
15 changes: 6 additions & 9 deletions src/components/touchables/TouchableNativeFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
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(() => {
class TouchableNativeFeedback extends RNTouchableNativeFeedback {
componentDidMount() {
console.warn(
tagMessage(
'TouchableOpacity component will be removed in the future version of Gesture Handler.'
'TouchableNativeFeedback component will be removed in the future version of Gesture Handler.'
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'TouchableNativeFeedback component will be removed in the future version of Gesture Handler.'

Let's remove this console.log as in other Touchables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 13b32eb

);
}, []);

return <RNTouchableNativeFeedback {...props} />;
};
return super.componentDidMount?.();
}
}

export default TouchableNativeFeedback;
Loading