Skip to content

Fix refs in Pressable leading to tree clone #39324

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

Closed
wants to merge 1 commit into from

Conversation

javache
Copy link
Member

@javache javache commented Sep 7, 2023

Summary:
useImperativeHandle without a dependencies array causes React to re-clone the tree, leading to undesirable layout effects.

Changelog: [Internal]

Differential Revision: D49056493

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Sep 7, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49056493

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,962,407 -57
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 9,554,306 +91
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: a228b0f
Branch: main

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Warnings
⚠️ One hour and a half have passed and the E2E jobs haven't finished yet.
⚠️

packages/react-native/Libraries/Components/Pressable/Pressable.js#L33 - packages/react-native/Libraries/Components/Pressable/Pressable.js line 33 – 'useImperativeHandle' is defined but never used. (no-unused-vars)

Generated by 🚫 dangerJS against 4ef69e3

javache added a commit to javache/react-native that referenced this pull request Sep 7, 2023
Summary:

`useImperativeHandle` without a dependencies array causes React to re-clone the tree, leading to undesirable layout effects.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D49056493
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49056493

javache added a commit to javache/react-native that referenced this pull request Sep 7, 2023
Summary:

`useImperativeHandle` without a dependencies array causes React to re-clone the tree, leading to undesirable layout effects.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D49056493
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49056493

Summary:

`useImperativeHandle` without a dependencies array causes React to re-clone the tree, leading to undesirable layout effects.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D49056493
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49056493

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

This pull request was successfully merged by @javache in cbf3b7d.

When will my fix make it into a release? | Upcoming Releases

@github-actions github-actions bot added the Merged This PR has been merged. label Sep 7, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in cbf3b7d.

@javache javache deleted the export-D49056493 branch September 8, 2023 12:36
@efstathiosntonas
Copy link

efstathiosntonas commented Sep 12, 2023

@javache I've applied this patch on 0.72.4, I have this dropdown https://github.com/MobileReality/react-native-select-pro and the dropdown wasn't reacting to touch events (they are using @gorhom/portal and Pressable). Without the patch is works fine.

I haven't tested it in normal Pressable, just wanted to bring this to your attention.

@javache
Copy link
Member Author

javache commented Sep 13, 2023

The regression introduced in this PR was resolved by 15a2980

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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants