I need to create a custom font that applies to every Text
component in the whole application.
Is there is a way to set a font globally in React Native?
One way is to create a wrapper for RN Text
say MyTextCustomFont:
const MyTextCustomFont = (props) => {
return (
<Text style={{fontFamily:'myFont'}} {...props} >{props.children}</Text>
)
}
import this MyTextCustomFont
and use anywhere.
Another way is to define a style object and use it wherever you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With