react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Allow implementing custom text parents as extensions of RCTText

Open DrRefactor opened this issue 1 year ago • 4 comments

Summary:

There's no way to implement:

  1. Custom text parent. Both Fabric and old renderers explicitely disallow this.
  2. Extension of RCTText, e.g. as an Android native module.

My use case: I needed to slightly override native behavior of ReactTextView, but conditions in React Native renderers make it impossible without monkey patching React Native.

Changelog:

[INTERNAL] [ADDED] - Option to extend native RCTText

Test Plan:

Create native module extending ReactTextViewManager with NAME starting with RCTTextExtension-.

DrRefactor avatar Jul 10 '24 07:07 DrRefactor

Hi @DrRefactor!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, 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.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

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

facebook-github-bot avatar Jul 10 '24 07:07 facebook-github-bot

Signed CLA now.

DrRefactor avatar Jul 10 '24 07:07 DrRefactor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

facebook-github-bot avatar Jul 10 '24 08:07 facebook-github-bot

To provide some motivation context, opening RCTText for extensions allow such features to be added in project scope: https://github.com/facebook/react-native/pull/45364

DrRefactor avatar Jul 10 '24 17:07 DrRefactor

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

react-native-bot avatar Aug 15 '25 05:08 react-native-bot

This PR was closed because it has been stalled for 7 days with no activity.

react-native-bot avatar Aug 23 '25 05:08 react-native-bot