From 774f28a32e27c16fa95d2de55463fd27d3c5d45f Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Mon, 20 Apr 2020 14:28:32 +0200 Subject: [PATCH] Moved assets loading in constructor to improve loading time --- App.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/App.js b/App.js index e732314..930e35c 100644 --- a/App.js +++ b/App.js @@ -66,6 +66,9 @@ export default class App extends React.Component { this.urlHandler = new URLHandler(this.onInitialURLParsed, this.onDetectURL); this.urlHandler.listen(); setSafeBounceHeight(Platform.OS === 'ios' ? 100 : 20); + this.loadAssetsAsync().then(() => { + this.onLoadFinished(); + }); } /** @@ -133,12 +136,6 @@ export default class App extends React.Component { this.storageManager.savePref(this.storageManager.preferences.showAprilFoolsStart.key, '0'); }; - componentDidMount() { - this.loadAssetsAsync().then(() => { - this.onLoadFinished(); - }); - } - /** * Loads every async data * @@ -175,7 +172,6 @@ export default class App extends React.Component { showUpdate: this.storageManager.preferences.updateNumber.current !== Update.number.toString(), showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && this.storageManager.preferences.showAprilFoolsStart.current === '1', }); - // SplashScreen.hide(); } /**