mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
⚡ Remove spurious deps from toggle callbacks in text-menu*
toggle-main-menu and toggle-more-options close over a state atom and need no external deps. The declared deps (main-menu-open? / more-options-open?) were unused inside the function bodies, causing each callback to be reallocated on every toggle — self-reinforcing churn. Drop the mf/deps calls to make both callbacks stable. Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
74d1288003
commit
7751d9a69b
@ -348,12 +348,10 @@
|
|||||||
;; --- Toggles
|
;; --- Toggles
|
||||||
toggle-main-menu
|
toggle-main-menu
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps main-menu-open?)
|
|
||||||
#(swap! menu-state* update :main-menu not))
|
#(swap! menu-state* update :main-menu not))
|
||||||
|
|
||||||
toggle-more-options
|
toggle-more-options
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps more-options-open?)
|
|
||||||
#(swap! menu-state* update :more-options not))
|
#(swap! menu-state* update :more-options not))
|
||||||
|
|
||||||
toggle-token-dropdown
|
toggle-token-dropdown
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user