Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

google font in react native

// 1) Install two package from expo 
// 1.1) visit https://directory.vercel.app/ and select font you want
// expo install @expo-google-fonts/FONT_FAMILY_NAME 
  //For example, if you choose to use lato we would install:
   //====== expo install @expo-google-fonts/lato     =======
//1.2) =====expo install expo-app-loading   ===========
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { AppLoading } from "expo-app-loading";
import {
  useFonts,
  Roboto_400Regular,
  Roboto_400Regular_Italic
} from "@expo-google-fonts/roboto";

export default function App() {
  let [fontsLoaded] = useFonts({
    Roboto_400Regular,
    Roboto_400Regular_Italic
  });

  if (!fontsLoaded) {
    return <AppLoading />;
  } else {
    return (
      <View style={{flex: 1, alignItems: "center", justifyContent: "center" }}>
        <Text style={{ fontFamily: "Roboto_400Regular", fontSize: 28 }}>
          Nice! Support for Google Fonts!
        </Text>
      </View>
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript wait for dom 
Javascript :: input type search clear event 
Javascript :: find in array and change 
Javascript :: html table to excel javascript 
Javascript :: layout nextjs 
Javascript :: download a file nodejs 
Javascript :: javascript how to check if array is empty 
Javascript :: table sort datatable 
Javascript :: nested objects javascript 
Javascript :: days difference in moment js 
Javascript :: jwt token expire time in node js 
Javascript :: javascript get element by id 
Javascript :: datatable order number 
Javascript :: .ajax how to get data from form 
Javascript :: angular json to file and download 
Javascript :: index.js:3 Uncaught ReferenceError: $ is not defined at index.js:3 
Javascript :: discord js clear message from id 
Javascript :: detect if two line segments intersect each other javascript 
Javascript :: retrieve data from option select js 
Javascript :: javascript get parent by tag 
Javascript :: ajax upload image 
Javascript :: for in 
Javascript :: basic express graphql 
Javascript :: javascript loop over the alphabet and return the vowels 
Javascript :: creating a 2d array in js 
Javascript :: vs code shows bodyparser deprecated 
Javascript :: error:03000086:digital envelope routines 
Javascript :: javascript get srollwidth 
Javascript :: download file from api vue 
Javascript :: angular bind style value 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =