-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Deprecate Touchables #2382
Comments
These components have been replaced by Pressable and will be removed from React Native. Fix #2382
These components have been replaced by Pressable and will be removed from React Native. Fix #2382
These components have been replaced by Pressable and will be removed from React Native. Fix #2382
These components have been replaced by Pressable and will be removed from React Native. Fix #2382
Hello @necolas are there any docs where I can learn about this? I looked for TouchableOpacity, the official docs doesn't say that is getting deprecated or no longer recommended to use. Thanks! |
@agusvazquez He seems to regularly deprecate things in RN Web ahead of core RN. I've encountered this twice now, pretty annoying. Edit: But, you know, thanks for everything you do Nicolas, it's your library and you are appreciated 🙏 |
@necolas I think It is a mistake. Pressable doesn't have press feedback by default, while TouchableOpacity does, and it works most of the time like a charm. Pressable requires additional programming of the feedback, so if we remove TouchableOpacity, everyone will actually implement it out of Pressable, which sounds like an excess work for no good reason. Also, by being not so flexible, TouchableOpacity seems to be a bit faster alternative. TouchableWithoutFeedback probably can be deprecated as it looks like a duplicate or Pressable, but other components, especially TouchableOpacity, IMO should not. |
RN itself has long intended to deprecate those components but just hasn't gotten around to doing so. If you're targeting web, you'll have to move off old APIs faster, because the cost of RN bloat on web is far too high both for me to maintain and for apps on web to be vaguely acceptable from a perf perspective. |
Isn't the purpose of this library to provide compatibility with React Native? Meaning, code in React Native and export for web. If you deprecate / remove TouchableOpacity you are literally breaking the main purpose of this library. IMO, As a mobile developer, I just want to do React Native work and export to web. That means supporting TouchableOpacity. |
@necolas may be they had I don't know, but they didn't, and for a reason. As I said, |
What is the main motivation of this decision while react-native still support it? |
This set up of Pressable is a good alternative to TouchableOpacity: <Pressable
style={({ pressed }) => [
{ opacity: pressed ? 0.5 : 1.0, backgroundColor: '#2782fb', width: 210, padding: 10, borderRadius: 12 }
]}
onPress={someFunction}
>
<View>
<Text className="font-semibold text-center text-[#fff]">Press Me</Text>
</View>
</Pressable> |
yes, its a good start, but without animation |
I think it was a wrong decision, but the library is awesome in general |
Hey there!
@necolas, do you have any source where the RN team suggests TouchableOpacity will be deprecated? Regards |
Is there an existing request?
Describe the feature request
The Touchables are no longer recommended in React Native and have been replaced by Pressable. We should deprecate the Touchable components and mixin, and then remove them from React Native for Web. There has been the intent to deprecate them from React Native for a while, but the team hasn't had time to get around to it yet.
The text was updated successfully, but these errors were encountered: