Issue
This Is MY Emulator and my fonts doesn't show here
import { StyleSheet, View , Text } from 'react-native';
import Main from './src/Components/MainInput';
import React, { useState } from 'react';
import { Scheme } from './src/Utils/ColorScheme';
import { Spacing } from './src/Utils/Spacing';
import GettingTime from './src/Components/GettingTime';
import { DancingScript_400Regular , useFonts } from '@expo-google-fonts/dancing-script';
export default function App() {
const [ data, addData ] = useState(null);
let [ fontsLoaded ] = useFonts({
DancingScript_400Regular,
});
if (!fontsLoaded) {
return null;
}
return (
<View style={styles.container}>
{data ? <GettingTime
givenData={data}
addData={addData}
/> : <Main adddata={addData}/>}
<View style={styles.copy}>
<Text style={styles.copyText}>This App is Created by © Hayder Ali. All © Copyrights and ™ Trademarks are reserved</Text>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Scheme.background,
alignItems: 'center',
paddingTop: Spacing.xxxxl
},
copy:{
padding:Spacing.md,
},
copyText:{
color:Scheme.Figures,
textAlign:"justify",
fontFamily:"normal"
}
});
Can Anyone tell me what am I doing wrong
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Solution
Step 1. Create assets Folder
Step 2. Create Fonts Folder
Step 3. Paste file in Fonts folder
Step 4. Add Fonts in Fonts folder
Step 5. Create react-native.config.js file
Step 6. Add this code in react-native.config.js file
module.exports = {
assets: ['./src/assets/Fonts'],
};
Step 7. Run npx react-native link command
Answered By - Souravs8616106
Answer Checked By - Robin (JavaFixing Admin)