Issue
Is there an equivalent to this CSS in React Native, so that the app uses the same font everywhere ?
body {
font-family: 'Open Sans';
}
Applying it manually on every Text node seems overly complicated.
Solution
The recommended way is to create your own component, such as MyAppText. MyAppText would be a simple component that renders a Text component using your universal style and can pass through other props, etc.
https://reactnative.dev/docs/text#limited-style-inheritance
Answered By - David E. Chen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.