fix comparison

This commit is contained in:
Ulises M 2024-12-16 19:30:57 -06:00
parent 226a8b221b
commit 05698c4d5e
No known key found for this signature in database
GPG Key ID: 5A15782EB758534E
1 changed files with 6 additions and 7 deletions

View File

@ -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)))