Skip to content

Pressability: Setup w/ Insertion Effect#55060

Closed
yungsters wants to merge 1 commit intofacebook:mainfrom
yungsters:export-D90192717
Closed

Pressability: Setup w/ Insertion Effect#55060
yungsters wants to merge 1 commit intofacebook:mainfrom
yungsters:export-D90192717

Conversation

@yungsters
Copy link
Contributor

Summary:
Ships the feature flag to use useInsertionEffect in Pressability, instead of useEffect.

Using useInsertionEffect enables Pressability to behave more predictability in component trees with <Activity mode="hidden"> because the events are scheduled more similarly to platform controls (e.g. focus and blur events will still fire even when "hidden").

Changelog:
[General][Changed] - Pressable no longer unmounts event listeners in a hidden Activity.

Differential Revision: D90192717

Summary:
Ships the feature flag to use `useInsertionEffect` in `Pressability`, instead of `useEffect`.

Using `useInsertionEffect` enables `Pressability` to behave more predictability in component trees with `<Activity mode="hidden">` because the events are scheduled more similarly to platform controls (e.g. focus and blur events will still fire even when "hidden").

Changelog:
[General][Changed] - `Pressable` no longer unmounts event listeners in a hidden `Activity`.

Differential Revision: D90192717
@facebook-github-bot facebook-github-bot added the p: Facebook Partner: Facebook label Jan 6, 2026
@meta-cla meta-cla 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 Jan 6, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 6, 2026

@yungsters has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90192717.

yungsters added a commit to yungsters/react-native that referenced this pull request Jan 6, 2026
Summary:

Ships the feature flag to use `useInsertionEffect` in `Pressability`, instead of `useEffect`.

Using `useInsertionEffect` enables `Pressability` to behave more predictability in component trees with `<Activity mode="hidden">` because the events are scheduled more similarly to platform controls (e.g. focus and blur events will still fire even when "hidden").

Changelog:
[General][Changed] - `Pressable` no longer unmounts event listeners in a hidden `Activity`.

Reviewed By: lunaleaps, javache

Differential Revision: D90192717
@meta-codesync meta-codesync bot closed this in c295ec2 Jan 6, 2026
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @yungsters in c295ec2

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jan 6, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 6, 2026

This pull request has been merged in c295ec2.

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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants