Skip to content
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

(feature) Better style support for text on native #49736

Open
nandorojo opened this issue Feb 27, 2025 · 3 comments
Open

(feature) Better style support for text on native #49736

nandorojo opened this issue Feb 27, 2025 · 3 comments
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info

Comments

@nandorojo
Copy link

nandorojo commented Feb 27, 2025

Description

Compared to View, <Text /> has extremely limited styling capabilities. These all have issues / don't work at all:

  • borderRadius
  • padding
  • height: 100%
  • width: 100%
  • flexGrow
  • flexBasis
  • justifyContent
  • alignItems

The list goes on. I wonder if this is a fundamental limitation of NativeTextComponent or if it could be fixed by forwarding more styles.

I have spent a lot of time trying to port web code/libraries to native, and this is a massive headache, mainly because all HTML elements let you render text without any limitations.

For example, every <span> I turn into <Text> results in totally incorrect styles.

I'd be happy to turn this into an umbrella issue and/or assist with PRs if there is some guidance on the best approach to take.

Related from react-strict-dom: facebook/react-strict-dom#278

Thanks!

Steps to reproduce

N/A

React Native Version

0.78.0

Affected Platforms

Runtime - iOS, Runtime - Android

Output of npx @react-native-community/cli info

N/A

Stacktrace or Logs

N/A

Reproducer

https://let-me-know-if-we-need-one.com

Screenshots and Videos

Happy to provide if needed, but the styles are no-ops so I'm not sure what I'd share.

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info labels Feb 27, 2025
@react-native-bot
Copy link
Collaborator

Warning

Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

@react-native-bot
Copy link
Collaborator

Warning

Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info
Projects
None yet
Development

No branches or pull requests

2 participants