reagent

A minimalistic ClojureScript interface to React.js http://reagent-project.github.io/
Fredrik Andersson 2021-02-04T15:34:06.041100Z

trying to figure out how to get rid of warning "Cannot infer target type in expression" when i try

:on-change #(emit :page-login-ssn-changed (.-target.value %))

juhoteperi 2021-02-04T15:35:10.041200Z

(.-target (.-value %)) or (.. % -target -value)

juhoteperi 2021-02-04T15:36:18.041400Z

.-target.value is not valid cljs, it happens to work by accident, but probably doesn't work with infer code.

juhoteperi 2021-02-04T15:37:18.041800Z

Or maybe you need to tag the event object, (fn [^js/Event e] (.. e -target -value))

Fredrik Andersson 2021-02-04T15:40:05.042Z

Found this: https://github.com/reagent-project/reagent/blob/master/doc/ManagingState.md and it shows the faulty version

Fredrik Andersson 2021-02-04T15:40:21.042300Z

However i try to change it

Fredrik Andersson 2021-02-04T15:41:19.042500Z

(.. % -target -value)
Works 🙏