How to set default font family in React Native?

Dagobert Renouf :

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.

David E. Chen :

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://facebook.github.io/react-native/docs/text.html#limited-style-inheritance

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Set default font family in React Native Expo project

How to set default font for whole React-Native application

Set a default font globally in React Native project

How to set default font family for entire Android app

How to set a global/default font-family without universal selectors?

how to set default font family available in android to action bar title

How to Change Font Family for textInput Placeholder in React Native

How to change the font family of Highchart to Bootstrap css default font family

Font family Roboto light and bold in react native

Unrecognized font family on iOS simulator with React Native

React Native Unrecognized font family not fixing

Unrecognized font family 'Roboto' - React Native iOS

React-Native - Unrecognized font family 'Ionicons'

How to change the default font family of a Flutter app

How to change the font family of a native base input?

How do you set a default font family when using a pre-made flutter theme?

How to set font family but retain fallback stack?

How to set the font family I want in css?

How to change font family in React Navigation createStackNavigator

Unrecognized font family 'anticon' in React-Native (iOS)

change top tabs font family in react-native-navigation (android)

React Native Paper - Unrecognized font family 'Material Icons'

How to use font-face font family in react component render?

How to set a default screen Route in react Tab Navigation in React Native

What is the default font family in HTML and how can I check this?

How to add default font-family to Tinymce output html

How to set default font for NSAttributedString

What's the default font family?

What is the default font family in Android?