Skip to content

Commit 99b30d2

Browse files
committed
fix comparison
1 parent 0560f79 commit 99b30d2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/react_native/fast_image.cljs

+6-7
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@
5656
:error? @error?
5757
:loaded? @loaded?}])])))
5858

59-
(defn- compare-sources
59+
(defn- compare-props
6060
[old-props new-props]
61-
(let [old-source (oops/oget old-props :source)
62-
new-source (oops/oget new-props :source)]
63-
(and old-source
64-
new-source
65-
(= (remove-port old-source) (remove-port new-source)))))
61+
(let [old-source (some-> old-props :source remove-port)
62+
new-source (some-> new-props :source remove-port)]
63+
(and (= old-source new-source)
64+
(= (dissoc old-props :source) (dissoc new-props :source)))))
6665

6766
(def fast-image
6867
(-> internal-fast-image
6968
(reagent/reactify-component)
70-
(rn/memo compare-sources)
69+
(rn/memo compare-props)
7170
(reagent/adapt-react-class)))

0 commit comments

Comments
 (0)