-
Notifications
You must be signed in to change notification settings - Fork 11
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
Crash when rendering Text within ShadowView within Text #17
Comments
@Titozzz why is importing it directly from react native isn't safe? |
@WadhahEssam well this isn't a public API and could break at any release. If you are fine with that point, you can totally use it. (We do) |
Hi @Titozzz, To be sure I understand correctly, could you tell me more about what you're trying to achieve?
|
Not trying to achieve anything special, usually we avoid nesting view within Text for the reasons listed above, but for some reason there were a few that slipped through. And when I replaced all our Views with ShadowedViews it crashed. It's not a huge deal since I now only replace Views if there are shadow styles + I removed the nested View as they should not have existed. Also just to be sure, I patched the lib so that it wouldn't crash. This issue was more a FYI than anything else! |
Describe the bug
When rendering something like
This is because in react-native, Views import TextAncestor context and set it to false (https://github.com/facebook/react-native/blob/0fb71630c7d4eff5758f7148ae2d9b1f09bc9d2c/packages/react-native/Libraries/Components/View/View.js#L130)
To reproduce
See above
Expected behavior
No crash
Your environment
N/Applicable.
TLDR: this crash is well identified and I've started a discussion with Meta engineers to know how we are supposed to proceed as importing from
'react-native/Libraries/Text/TextAncestor'
isn't safe, this is more to let other people having this issue that it's being looked at.The text was updated successfully, but these errors were encountered: