Reputation: 86
This Is MY Emulator and my fonts doesn't show here
MY Code is
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?
Upvotes: 2
Views: 1437
Reputation: 381
module.exports = {
assets: ['./src/assets/Fonts'],
};
npx react-native link
commandUpvotes: 1
Reputation: 912
For one I had to delete a fontWeight: 'bold'
declaration I had made because that's actually not allowed. Secondly I had to restart my expo server. I tried adding the 'bold' declaration back afterward to test it and it indeed broke it again.
Upvotes: 5