Fork me on GitHub
#reagent
<
2019-12-05
>
Alexander Knemeyer12:12:45

Hey everyone. I'd like to open a new window but let it share state with the original window. I see how I could do this with a draggable modal, but I'm hoping for something which could eg. be moved over to a second monitor, so that you could use the original and new window at the same time. I know how to do the absolute basics of new window stuff (basically just (js/window.open "" "_blank" "height=200,width=200")) and have a vague understanding of react portals https://github.com/reagent-project/reagent/blob/master/doc/ReactFeatures.md but I just don't seem to understand how to bridge the two. Could anyone help with a tiny code snippet? eg. storing a counter atom in the original window, which is live-displayed in a popup component I'm quite new to js and cljs - please let me know I'm approaching this in a silly way!

Alexander Knemeyer12:12:36

Ah, I think I asked too soon. I just found this tutorial https://medium.com/hackernoon/using-a-react-16-portal-to-do-something-cool-2a2d627b0202 in case anyone else wants to know the answer