Skip to content

Create test to move parts of TextInput state to refs to avoid unnecessary updates in effects#45321

Closed
rubennorte wants to merge 2 commits into
facebook:mainfrom
rubennorte:export-D59400624
Closed

Create test to move parts of TextInput state to refs to avoid unnecessary updates in effects#45321
rubennorte wants to merge 2 commits into
facebook:mainfrom
rubennorte:export-D59400624

Conversation

@rubennorte
Copy link
Copy Markdown
Contributor

Summary:
Changelog: [internal]

This creates a variant of the internal hook in TextInput that handles the synchronization of the state between native and JS. The new variant moves everything that's not needed for rendering to refs instead of state.

One of the reasons for this change is that by not setting state in layout effects, we're not forcing passive effects to be flushed synchronously, which can improve perceived performance (as we can start painting before passive effects are executed).

Reviewed By: sammy-SC

Differential Revision: D59400624

rubennorte and others added 2 commits July 8, 2024 05:39
…sary updates in effects

Summary:
Changelog: [internal]

This creates a variant of the internal hook in `TextInput` that handles the synchronization of the state between native and JS. The new variant moves everything that's not needed for rendering to refs instead of state.

One of the reasons for this change is that by not setting state in layout effects, we're not forcing passive effects to be flushed synchronously, which can improve perceived performance (as we can start painting before passive effects are executed).

Reviewed By: sammy-SC

Differential Revision: D59400624
@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 8, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

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

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 21,285,839 +721
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 24,482,250 +242
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 83392a9
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in ef9b2ba.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 8, 2024
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.

3 participants