Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadAssets = async() => {
// Font Preloading
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
'Sweet Sensations Persona Use': require('./assets/Sweet_Sensations_Persona_Use.ttf'),
'Noto Sans KR': require('./assets/NotoSansKR-Regular.otf'),
'Noto Sans KR Bold': require('./assets/NotoSansKR-Bold.otf'),
'Noto Serif KR': require('./assets/NotoSerifKR-Regular.otf'),
'Noto Serif KR Bold': require('./assets/NotoSerifKR-Bold.otf'),
});
// Images Preloading
// await Asset.loadAsync([
// require("./assets/icon.png")
// ])
console.log('loadAssets complete!!!');
}
async componentWillMount() {
await Font.loadAsync({
Roboto: require('native-base/Fonts/Roboto.ttf'), // eslint-disable-line global-require
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'), // eslint-disable-line global-require
Ionicons: require('@expo/vector-icons/fonts/Ionicons.ttf'), // eslint-disable-line global-require
});
this.setState({ isReady: true });
}
_loadResourcesAsync = async () => Promise.all([
Asset.loadAsync([
require('../assets/images/robot-dev.png'),
require('../assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Icon.Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free
// to remove this if you are not using it in your app
// 'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
'open-sans-regular': require('../assets/fonts/OpenSans-Regular.ttf'),
'open-sans-bold': require('../assets/fonts/OpenSans-Bold.ttf'),
'open-sans-semi-bold': require('../assets/fonts/OpenSans-SemiBold.ttf'),
}),
]);
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Icon.Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free
// to remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
this._loadPersistedState(),
]);
};
return fonts.map(font => Font.loadAsync(font));
}
async componentDidMount() {
await Font.loadAsync({
dogbyte: require('./assets/fonts/dogbyte.otf'),
});
this.setState({ isFontLoaded: true });
}
async componentWillMount() {
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf")
});
this.setState({ loading: false });
}
return fonts.map(font => Font.loadAsync(font));
}
return fonts.map(font => Font.loadAsync(font));
}