From 05698c4d5efb1180135a28b49ef31b707e13b6c4 Mon Sep 17 00:00:00 2001 From: Ulises M Date: Mon, 16 Dec 2024 19:30:57 -0600 Subject: [PATCH] fix comparison --- src/react_native/fast_image.cljs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/react_native/fast_image.cljs b/src/react_native/fast_image.cljs index 68b96b69b1..edf6136fcb 100644 --- a/src/react_native/fast_image.cljs +++ b/src/react_native/fast_image.cljs @@ -56,16 +56,15 @@ :error? @error? :loaded? @loaded?}])]))) -(defn- compare-sources +(defn- compare-props [old-props new-props] - (let [old-source (oops/oget old-props :source) - new-source (oops/oget new-props :source)] - (and old-source - new-source - (= (remove-port old-source) (remove-port new-source))))) + (let [old-source (some-> old-props :source remove-port) + new-source (some-> new-props :source remove-port)] + (and (= old-source new-source) + (= (dissoc old-props :source) (dissoc new-props :source))))) (def fast-image (-> internal-fast-image (reagent/reactify-component) - (rn/memo compare-sources) + (rn/memo compare-props) (reagent/adapt-react-class)))