Fork me on GitHub
#untangled
<
2016-06-08
>
jasonjckn00:06:40

When i render (dom/div #js {} #js {}) I get "1113 Uncaught Invariant Violation: Objects are not valid as a React child "

jasonjckn00:06:54

and this permanently fries my figwheel session until I do a browser refresh

jasonjckn00:06:04

i just checked this out in reagent and it recovers itself easily

jasonjckn00:06:20

I wonder if there's something I can pass to figwheel-reload-hook that would reset react

jasonjckn00:06:26

the way reagent is doing this

jasonjckn00:06:47

i already tried calling uc/mount again and transact! [ :ui/react-key]

therabidbanana00:06:40

I think you probably want something more like (dom/div #js {} []) - where the second argument is an empty array.

therabidbanana00:06:23

(I'm used to looking at it in https://github.com/r0man/sablono style, so maybe I'm getting that wrong, but the second arg is a list of elements to nest I think)

therabidbanana00:06:05

Or is the problem more that you don't want syntax errors to kill your session?

jasonjckn00:06:20

i tried

(defn figwheel-reload-hook []
  (log/info "figwheel-reload-hook")
  (set! (.-innerHTML (js/document.getElementById "app")) "")
  (reset! core/app (uc/mount @core/app ui/Root "app"))
  )

jasonjckn00:06:30

and many other things

therabidbanana15:06:01

We use boot-reload, but I think we've had the same issue, especially when messing around with lifecycle methods I think - can get in a state where the only way to get back to a good state is just refreshing.

jasonjckn17:06:17

it's interesting that reagent can recover

jasonjckn17:06:46

there's probably some fix for this in om.next, i'll maybe file a bug report