-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
->clj with React events #77
Comments
Seems similar to #76 |
I've experienced this as well. data coming from a callback in a separate react lib built with typescript. Fortunately I maintain the typescript lib so I was able to workaround by converting all data to plain js objects (using Object.assign) and then both ->clj and recursive bean worked fine. Before the workaround, object? was false and then true for the plain js objects. Not ideal for people using 3rd party libs where they can't use the same workaround at the source. |
Ran into this myself on several occasions. Worth mentioning is that not even Most of the time I've used lightweight functions to transform the events to clj maps: (defn event->map
[e]
{:type (.-type e)
:target (.-target e)
:current-target (.-currentTarget e)
:prevent-default #(.preventDefault e)
;; ... other keys if needed
}) |
I've tried using
->clj
with mouse events in a Reagent app with both(fn [e] (->clj e) ...)
where the fn is the handler for the event, but it doesn't convert (it remains JS object). Using->clj
on the event's.-nativeEvent
doesn't work either - what should I do ?The text was updated successfully, but these errors were encountered: