Fork me on GitHub
#shadow-cljs
<
2020-12-11
>
Singh20:12:27

Hi Everyone, I am a JavaScript dev (new to clojure), I am working with yarn package react-google-recaptcha. I am currently facing an issue to get back a token after verifying the recaptcha. If I do it in Javascript the onChange(value) function returns the token

function onChange(value) {
  console.log("Captcha value:", value);
}
 
ReactDOM.render(
  <ReCAPTCHA
    sitekey="Your client site key"
    onChange={onChange}
  />,
  document.body
);
But I try this in ClojureScript and I am getting nothing in the console
(defn onChange [value] 
       (println value)
)

($ ReCAPTCHA 
    { :sitekey "Your client site key" 
      :onChange #(onChange) })
(note $ is helix lib)
it tell me that wrong number of args (0) passed to onChange Can someone please tell where am I wrong?

dpsutton20:12:06

@singhamritpal49 also i think this is just a clojurescript question and so belongs in #clojurescript in the future

Singh20:12:23

Got it sorry for the mistake.

dpsutton20:12:47

no worries. its really to make sure the greatest number of people who could help actually see your question