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

feat: add support for raw RTCView and RCTText #537

Merged
merged 2 commits into from
Jan 30, 2025
Merged

feat: add support for raw RTCView and RCTText #537

merged 2 commits into from
Jan 30, 2025

Conversation

jpudysz
Copy link
Owner

@jpudysz jpudysz commented Jan 29, 2025

Summary

Based on @hirbod snippet :D

  • Check Android & web

Implements #461

@jpudysz jpudysz requested a review from Brentlok January 29, 2025 16:36
Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-unistyles-2.0 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2025 8:24am
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2025 8:24am

@hirbod
Copy link

hirbod commented Jan 29, 2025

Just be careful that nested LeanText elements don’t inherit styles, which can sometimes cause issues with width calculations in specific scenarios where nested elements accumulate for a specific width. If you nest LeanText, each instance needs its own style since it doesn’t inherit from the wrapped parent.

Also, keep in mind that you lose onPress on Text, but you gain a lot of performance. RN 0.77 includes an optimized Text, by the way. It still has context but is much lighter than before. LeanText was winning in every benchmark.

@jpudysz
Copy link
Owner Author

jpudysz commented Jan 30, 2025

Thanks for the info!

The user needs to be aware of these limitations on their own. I’m just converting it to the Unistyles version, which will be auto-updated from the shadow tree without re-renders.

Your snippet helped me a lot, as I struggled with creating an instance. Now it works perfectly. Thank you again!

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