File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/react-native-bottom-tabs/ios Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -239,11 +239,13 @@ public final class TabInfo: NSObject {
239239 }
240240
241241 private func loadIcons( _ icons: NSArray ? ) {
242+ guard let imageLoader else { return }
243+
242244 // TODO: Diff the arrays and update only changed items.
243245 // Now if the user passes `unfocusedIcon` we update every item.
244246 if let imageSources = icons as? [ RCTImageSource ? ] {
245247 for (index, imageSource) in imageSources. enumerated ( ) {
246- guard let imageSource, let imageLoader else { continue }
248+ guard let imageSource else { continue }
247249 imageLoader. loadImage (
248250 with: imageSource. request,
249251 size: imageSource. size,
@@ -258,7 +260,8 @@ public final class TabInfo: NSObject {
258260 return
259261 }
260262 guard let image else { return }
261- DispatchQueue . main. async {
263+ DispatchQueue . main. async { [ weak self] in
264+ guard let self else { return }
262265 self . props. icons [ index] = image. resizeImageTo ( size: self . iconSize)
263266 }
264267 } )
You can’t perform that action at this time.
0 commit comments