Fork me on GitHub
#fulcro
<
2019-08-09
>
souenzzo14:08:32

Using fulcrologic/fulcro {:mvn/version "2.8.12"} When I add in [:reconciler-options :tx-listen] any function (constantly nil), my inspector stop to show transactions

exit218:08:17

Is it possible to pass DOM elements as props? (i.e. {:some-content (dom/div "Foo")}) and if so, how would I render it?

wilkerlucio18:08:08

@njj yes, just put that on the render, like if you were putting a string or anything

exit219:08:36

Strange, I get an error when trying that:

exit219:08:39

Objects are not valid as a React child (found: fulcro.client.dom/div). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons.

exit219:08:15

Can you share a working example? @U066U8JQJ

wilkerlucio19:08:45

sorry, no time to write one and test now, but the error looks like you tried to send the symbol of the div isntead of the return of (dom/div ...)

wilkerlucio18:08:24

another common pattern is to send a factory, so you can it during the render, both works

souenzzo18:08:56

(defn render-user [title body] (dom/div (dom/p title) body)) where you call (render-users "hello" (for [i users] (dom/div {:key i} (str i)))

souenzzo18:08:59

something like this.