Skip to content

Commit

Permalink
fix comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesmac committed Dec 17, 2024
1 parent 0560f79 commit 99b30d2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/react_native/fast_image.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

0 comments on commit 99b30d2

Please sign in to comment.