Skip to content

React 19 APIs #133

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

React 19 APIs #133

wants to merge 11 commits into from

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Apr 27, 2025

Closes #130

@@ -25,6 +25,23 @@ module Client = {
external hydrateRoot: (Dom.element, React.element) => Root.t = "hydrateRoot"
}

// Very rudimentary form data bindings
module FormData = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is certainly not ideal, but I don't want to drag the new WebAPI in yet.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense for now. The folks that do use the new WebAPI can always convert it.


/** `use` is a React API that lets you read the value of a resource like a Promise or context. */
@module("react")
external use: Usable.t<'value> => 'value = "use"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a good idea? Or should we just have multiple bindings for use (useContext, usePromise, ...).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe multiple bindings is more ergonomic. With good code examples what they do, the difference in name is doable.

@nojaf
Copy link

nojaf commented Apr 28, 2025

Makes me wonder if we should not bite the bullet and move jsxDOMProps here since we are having a major.

PRs like rescript-lang/rescript#7402 are a good example that the current setup isn't ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants