om

Please ask the channel first, not @dnolen directly!
steveb8n 2017-08-19T00:13:00.000065Z

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.`

tony.kay 2017-08-19T02:12:15.000069Z

@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.

tony.kay 2017-08-19T02:12:39.000088Z

My guess is you forgot the #js?

tony.kay 2017-08-19T02:12:53.000072Z

or call to clj-&gt;js if it’s a clojure persistent data structure in cljs

tony.kay 2017-08-19T02:13:21.000098Z

since those sound like the internal impl props within a clj data structure

steveb8n 2017-08-19T02:13:27.000042Z

@tony.kay I noticed that they are attributes in a cljs map

steveb8n 2017-08-19T02:13:46.000015Z

so props passed to any component must be in js shape

tony.kay 2017-08-19T02:13:49.000043Z

(dom/div #js { :className "a"} ...)

tony.kay 2017-08-19T02:13:51.000024Z

yes

tony.kay 2017-08-19T02:14:05.000051Z

or (dom/div (clj-&gt;js {:className "a"}))

tony.kay 2017-08-19T02:14:20.000007Z

the latter is nice if you’re doing manipulation of a data structure in advance

steveb8n 2017-08-19T02:14:25.000054Z

cool. I started with om server side rendering so clj maps worked ok there

tony.kay 2017-08-19T02:14:30.000023Z

yep

tony.kay 2017-08-19T02:14:40.000023Z

#js is identity on th eserver

steveb8n 2017-08-19T02:15:07.000063Z

ah ok, I’ll try that. thanks

tony.kay 2017-08-19T02:15:19.000014Z

I have SSR stuff in cljc, and I def clj-&gt;js to identity..then the code works in both

steveb8n 2017-08-19T02:15:38.000039Z

me too 🙂

tony.kay 2017-08-19T02:15:46.000059Z

If you look in the om source, it has a data readers file for defining #js I think on the clj side

steveb8n 2017-08-19T02:16:17.000021Z

thanks again, now I know I’m looking in the right place

drcode 2017-08-19T15:01:50.000004Z

@steveb8n Another option is to use plumatic om-tools https://github.com/plumatic/om-tools

drcode 2017-08-19T15:02:21.000005Z

it automatically takes care of the js conversions

drcode 2017-08-19T15:02:38.000113Z

I use it for all my om projects