Reduce startup hang by not querying fonts (#9670)
* query fonts lazily * use `lazy var`
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
diff --git a/node_modules/expo-font/ios/FontLoaderModule.swift b/node_modules/expo-font/ios/FontLoaderModule.swift
|
||||||
|
index 183480f..7b64f6e 100644
|
||||||
|
--- a/node_modules/expo-font/ios/FontLoaderModule.swift
|
||||||
|
+++ b/node_modules/expo-font/ios/FontLoaderModule.swift
|
||||||
|
@@ -2,10 +2,9 @@ import ExpoModulesCore
|
||||||
|
|
||||||
|
public final class FontLoaderModule: Module {
|
||||||
|
// could be a Set, but to be able to pass to JS we keep it as an array
|
||||||
|
- private var registeredFonts: [String]
|
||||||
|
+ private lazy var registeredFonts: [String] = queryCustomNativeFonts()
|
||||||
|
|
||||||
|
public required init(appContext: AppContext) {
|
||||||
|
- self.registeredFonts = queryCustomNativeFonts()
|
||||||
|
super.init(appContext: appContext)
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user