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

feat: add displayName to touchables #29531

Conversation

brunohkbx
Copy link
Contributor

@brunohkbx brunohkbx commented Jul 30, 2020

Summary

Since TouchableHighlight and TouchableOpacity are being exported using forwardRef, it's messing up jest's snapshots and some matchers.
This commit 4b935ae fixed this for components being mocked on setup.js. However, these Touchables aren't being mocked.

It resolves #27721

Changelog

[General] [Added] - Add displayName to TouchableHighlight, TouchableOpacity, TouchableNativeFeedback, TouchableWithoutFeedback

Test Plan

Check the new snapshots.

@facebook-github-bot
Copy link
Contributor

Hi @brunohkbx!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Jul 30, 2020
@analysis-bot
Copy link

analysis-bot commented Jul 30, 2020

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,894,411 +39
android hermes armeabi-v7a 8,390,918 +30
android hermes x86 9,386,042 +38
android hermes x86_64 9,329,152 +38
android jsc arm64-v8a 10,349,774 +0
android jsc armeabi-v7a 9,829,391 +0
android jsc x86 10,402,892 +0
android jsc x86_64 10,986,267 +0

Base commit: 811ccec

@analysis-bot
Copy link

analysis-bot commented Jul 30, 2020

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: a15a46c

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 30, 2020
@CoryWritesCode
Copy link

@brunohkbx seems like TouchableWithoutFeedback is also effected by this.

@brunohkbx
Copy link
Contributor Author

@CoryWritesCode will update this one as well.

@brunohkbx brunohkbx force-pushed the feat/add-display-name-to-touchables branch 2 times, most recently from 60d2a63 to dbdef0c Compare December 30, 2020 19:13
@brunohkbx brunohkbx changed the title feat: add displayName to TouchableHighlight and TouchableOpacity feat: add displayName to touchables Dec 30, 2020
@kelset kelset requested a review from yungsters January 4, 2021 09:58
@brunohkbx brunohkbx force-pushed the feat/add-display-name-to-touchables branch from 62fe590 to 030ca58 Compare March 14, 2021 19:37
@brunohkbx
Copy link
Contributor Author

@yungsters would you mind reviewing this? Thanks in advance.

@facebook-github-bot
Copy link
Contributor

@yungsters has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@yungsters
Copy link
Contributor

This looks good. Thanks for the contribution and tagging me! Sorry for taking so long to get to reviewing this.

TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback, TouchableNativeFeedback
@brunohkbx brunohkbx force-pushed the feat/add-display-name-to-touchables branch from 030ca58 to 5b54e1e Compare March 31, 2021 23:12
@brunohkbx
Copy link
Contributor Author

brunohkbx commented Mar 31, 2021

Thanks @yungsters. I just fixed the conflicts.

@facebook-github-bot
Copy link
Contributor

@yungsters merged this pull request in c4e40b8.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Apr 1, 2021
@brunohkbx brunohkbx deleted the feat/add-display-name-to-touchables branch April 1, 2021 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RN v0.62.0-rc.0 - Touchable[Highlight|WithoutFeedback] are rendering into a component without name under jest
6 participants