mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 00:28:20 -05:00
✨ Use properly the react hook
We can't use hooks in a condition, the condition should be inside the hook.
This commit is contained in:
parent
d2aa985714
commit
9263f70d6a
1 changed files with 4 additions and 3 deletions
|
@ -70,9 +70,10 @@
|
|||
(when (and (some? dom) (some? submenu-node))
|
||||
(dom/set-css-property! submenu-node "top" (str (.-offsetTop dom) "px"))))))]
|
||||
|
||||
(when on-unmount
|
||||
(mf/use-effect
|
||||
(fn [] on-unmount)))
|
||||
|
||||
(mf/use-effect
|
||||
(mf/deps on-unmount)
|
||||
(constantly on-unmount))
|
||||
|
||||
(if icon
|
||||
[:li.icon-menu-item {:ref set-dom-node
|
||||
|
|
Loading…
Add table
Reference in a new issue