Uh oh!
There was an error while loading. Please reload this page.
Use new WebAPI - #121
Conversation
Freddy03h
commented
Dec 3, 2025
Hi @nojaf ! |
nojaf
commented
Dec 3, 2025
Feel free to push to this branch. |
9bc47ad to
bc25412CompareFreddy03h
commented
Dec 4, 2025
Hi, I'm testing the PR. Is this the way to letonChange= (event: ReactEvent.Form.t) => {
letinput: WebAPI.DOMAPI.htmlInputElement=event->ReactEvent.Form.target->WebAPI.Prelude.unsafeConversationhandleChange(input.value)
} |
nojaf
commented
Dec 4, 2025
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. |
Freddy03h
commented
Dec 4, 2025
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. |
nojaf
commented
Dec 4, 2025
Maybe a helper to get the |
Freddy03h
commented
Dec 4, 2025
For forms & inputs, yes, but that doesn’t solve other types of events. On |
nojaf
commented
Dec 5, 2025
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)