Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detach-root #140

Open
danjohansson opened this issue Jun 20, 2018 · 1 comment
Open

detach-root #140

danjohansson opened this issue Jun 20, 2018 · 1 comment

Comments

@danjohansson
Copy link

danjohansson commented Jun 20, 2018

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

    (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

@bhauman
Copy link
Owner

bhauman commented Sep 5, 2018

Yeah I'm trying to fix this for all cases and this solution doesn't seem to work reliably, this is really hard to fix because we are rending a react tree within a react tree. It's limitation with om's current design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants