mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 08:11:30 -05:00
Add equality check for local mixin for avoid rerenders.
This commit is contained in:
parent
dae971a96c
commit
2fed551cf1
1 changed files with 3 additions and 2 deletions
|
@ -119,8 +119,9 @@
|
|||
(let [local-state (atom initial)
|
||||
component (:rum/react-component state)]
|
||||
(add-watch local-state key
|
||||
(fn [_ _ _ _]
|
||||
(rum/request-render component)))
|
||||
(fn [_ _ oldv newv]
|
||||
(when (not= oldv newv)
|
||||
(rum/request-render component))))
|
||||
(assoc state key local-state)))
|
||||
}))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue