You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code can not work. It calls TextRender.apply with the original arguments, it assigns new props ignoring the Text.defaultProps.style and then assigns the props back in the finally block to no effect.
Thanks for your feedback! I wonder how could the current code ever work? Or was just nobody using it?
I also wonder why RN does not offer this by default. I tried to search the issues over there but no-one seems to be missing setting a font globally for all Text elements. Everyone seems to be happy to derive a custom Text component for their apps that no one developer of this app should ever forget to use. And then there are 3rd party components that render just the default RN Text component and sometimes don't give you the styling options to change that.
Really confusing why this is not part of the default RN lib.
This project lacks some tests to verify the functionality.
Do you have any plans to add tests or would accept a PR?
Case in point:
This code can not work. It calls TextRender.apply with the original
arguments
, it assigns newprops
ignoring theText.defaultProps.style
and then assigns the props back in thefinally
block to no effect.Tests would discover this faulty behaviour.
A working version of the above code seems to be:
The text was updated successfully, but these errors were encountered: