mirror of
https://github.com/penpot/penpot.git
synced 2025-07-28 07:37:26 +02:00
✨ Add more memoization hooks.
This commit is contained in:
parent
162fe5219c
commit
032252469b
3 changed files with 84 additions and 72 deletions
|
@ -25,8 +25,12 @@
|
|||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
frame (unchecked-get props "frame")
|
||||
on-mouse-down #(common/on-mouse-down % shape)
|
||||
on-context-menu #(common/on-context-menu % shape)]
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down % shape))
|
||||
on-context-menu (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-context-menu % shape))]
|
||||
[:g.shape {:on-mouse-down on-mouse-down
|
||||
:on-context-menu on-context-menu}
|
||||
[:& rect-shape {:shape (geom/transform-shape frame shape) }]]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue