-
Notifications
You must be signed in to change notification settings - Fork 44
Use new WebAPI #121
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
base: master
Are you sure you want to change the base?
Use new WebAPI #121
Conversation
|
Hi @nojaf ! |
|
Feel free to push to this branch. |
|
Hi, I'm testing the PR. Is this the way to let onChange = (event: ReactEvent.Form.t) => {
let input: WebAPI.DOMAPI.htmlInputElement =
event->ReactEvent.Form.target->WebAPI.Prelude.unsafeConversation
handleChange(input.value)
} |
|
Hey Freddy, Yeah, that is still a bit of a tricky one. The target can be multiple things (for example
One other thing that comes to mind here is to do an inline %raw But yeah, no ideal solution. |
|
The previous I don’t see a better solution than providing a custom Event for each HTML element, so that Typing the DOM API is hard. Something like react-strict-dom would probably be easier - but that’s off topic. I think the current WebAPI approach is fine as it is; it’s permissive. |
|
Maybe a helper to get the |
|
For forms & inputs, yes, but that doesn’t solve other types of events. On |
|
Because |
This is a sample PR to illustrate the usage of the new WebAPI.
Some types in ReactDOM and ReactEvent were changed to match the new bindings.
As only the new types are used (which will be quite stable), this might not be as radical a change.
(PS: not saying we should merge this PR anytime soon)