Skip to content

Memoize Text component#4003

Open
m-bert wants to merge 12 commits intomainfrom
@mbert/memo-text
Open

Memoize Text component#4003
m-bert wants to merge 12 commits intomainfrom
@mbert/memo-text

Conversation

@m-bert
Copy link
Contributor

@m-bert m-bert commented Feb 27, 2026

Description

This PR introduces 3 changes to Text component

  • Removes forwardedRef
  • Adds memoization

Test plan

Tested on "Nested Text" example

Copilot AI review requested due to automatic review settings February 27, 2026 12:04
@m-bert m-bert marked this pull request as ready for review February 27, 2026 12:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Gesture Handler Text wrapper component by renaming it to LegacyText and adjusting its implementation to remove forwardRef and add memoization for the native gesture instance, with the example app updated accordingly.

Changes:

  • Renamed the exported component from Text to LegacyText at the package entrypoint.
  • Reworked the Text wrapper implementation (removed forwardRef, memoized Gesture.Native() instance).
  • Updated the “Nested Text” release test to use LegacyText.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
packages/react-native-gesture-handler/src/index.ts Renames the public export from Text to LegacyText.
packages/react-native-gesture-handler/src/components/Text.tsx Reimplements the wrapper as LegacyText, changes ref handling approach, and memoizes the native gesture.
apps/common-app/src/legacy/release_tests/nestedText/index.tsx Migrates the test example to import/use LegacyText.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants