-
Notifications
You must be signed in to change notification settings - Fork 65
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
How can I access event.target.value? #158
Comments
You should be able to pass the purescript-react/src/React/SyntheticEvent.purs Lines 272 to 273 in e059deb
This would give you a Hope this helps. |
I think |
@natefaubion purescript-react/src/React/SyntheticEvent.purs Lines 359 to 360 in e059deb
I'm happy to make a PR adding it if so. |
I am using the purescript-react library to create an app.
I am trying to handle an onChange event on an input element:
input [ Props.onChange $ \evt -> do
...
]
I want to access
evt.target.value
(as I would in Javascript).Here's what the types look like:
type SyntheticInputEvent = SyntheticEvent_ (SyntheticUIEvent' ( SyntheticEvent' () ))
foreign import data SyntheticEvent_ :: # Type -> Type
type SyntheticUIEvent' r = (detail :: Number, view :: NativeAbstractView | r)
type SyntheticEvent' r = (bubbles :: Boolean, target :: NativeEventTarget, ... | r)
I have tried doing the following:
input [ Props.onChange $ evt -> do
let SyntheticEvent_ (SyntheticUIEvent' { detail: detail, view: view, target: target }) = evt
...
]
But that doesn't work.
Any suggestions?
The text was updated successfully, but these errors were encountered: