From 43d1ec8f224ebdbd153112a3d3d9193022e52156 Mon Sep 17 00:00:00 2001 From: Mohsen Date: Tue, 12 Dec 2023 08:06:27 +0300 Subject: [PATCH] [#17393] fix: improve flat-list performance --- src/status_im/contexts/profile/settings/view.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/status_im/contexts/profile/settings/view.cljs b/src/status_im/contexts/profile/settings/view.cljs index 8ddaf90a9255..9976fda8e9b6 100644 --- a/src/status_im/contexts/profile/settings/view.cljs +++ b/src/status_im/contexts/profile/settings/view.cljs @@ -35,6 +35,10 @@ :icon-left :i/log-out} (i18n/label :t/logout)]]) +(defn- get-item-layout + [_ index] + #js {:length 48 :offset (* 48 index) :index index}) + (defn- settings-view [theme] (let [insets (safe-area/get-insets) @@ -60,6 +64,9 @@ :header [settings.header/view {:scroll-y scroll-y}] :data settings.items/items :key-fn :title + :get-item-layout get-item-layout + :initial-num-to-render 6 + :max-to-render-per-batch 6 :shows-vertical-scroll-indicator false :render-fn settings-item-view :footer [footer logout-press]