has anyone seen this warning in om.next before? Warning: Unknown props
meta`, cnt
, arr
, __hash
, cljs$lang$protocol_mask$partition0$
, cljs$lang$protocol_mask$partition1$
on <div> tag. Remove these props from the element.`
@steveb8n Yes. It means the props you sent to a div tag are not know by the underlying React DOM function, and it is warning you incase you misspelled them.
My guess is you forgot the #js
?
or call to clj->js
if it’s a clojure persistent data structure in cljs
since those sound like the internal impl props within a clj data structure
@tony.kay I noticed that they are attributes in a cljs map
so props passed to any component must be in js shape
(dom/div #js { :className "a"} ...)
yes
or (dom/div (clj->js {:className "a"}))
the latter is nice if you’re doing manipulation of a data structure in advance
cool. I started with om server side rendering so clj maps worked ok there
yep
#js
is identity
on th eserver
ah ok, I’ll try that. thanks
I have SSR stuff in cljc, and I def clj->js
to identity
..then the code works in both
me too 🙂
If you look in the om source, it has a data readers file for defining #js
I think on the clj side
thanks again, now I know I’m looking in the right place
@steveb8n Another option is to use plumatic om-tools https://github.com/plumatic/om-tools
it automatically takes care of the js conversions
I use it for all my om projects