Fork me on GitHub
#fulcro
<
2020-02-21
>
otwieracz07:02:18

Hmm. Any ideas why:

otwieracz07:02:48

When sent to query with this button:

otwieracz07:02:09

seems to be invalid, or something:

otwieracz07:02:16

This comes from union query

otwieracz07:02:50

It's union of {:text-object/id [...] :tag-link/id [...]}

holyjak11:02:46

Hi! Are there some tricks necessary to be able to pass a function to a react JS component? I have one that has an onClick property however it seems the value is not passed on:

(ns .. (:require ["@telia/styleguide" :as styleguide :refer [FeatureBox]]))
(def ui-sg-feature-box (interop/react-factory FeatureBox))
(ui-sg-feature-box {:onClick (fn [_] (println "HELLO!"))})
When I click the generated button, nothing is printed out - and in the React Tools there is no value for the onClick prop. Thank you!

4
souenzzo11:02:23

try (.warn js/console "HELLO!")

holyjak12:02:49

println works, I have tried that inside (dom/button {:onClick (fn [] ...)}) . Anyway, .warn does not print anything either. Is it possible that interop/react-factory does something that breaks fn props?

holyjak16:02:27

Solved it, there were two components called FeatureBox and I have been using the wrong one.