bhauman / bhauman/devcards

detach-root

Open
#140 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
1.5k
Forks
106
PR merge metrics
No merged PRs in 30d

Description

When using defcard-om with an atom as state.
Navigating back and forth between the namespace list and the devcard keeps adding om roots that are not detached when navigating back.
I tried this as a workaround
```om/IWillUnmount
(will-unmount [_]
(println "unmounting this")
(let [pn (.-parentNode (om/get-node owner))]
(js/setTimeout (fn [] (om/detach-root pn)) 200)))
```
and it seems to do the trick.

regards
Dan

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.