-
Notifications
You must be signed in to change notification settings - Fork 348
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
Add React 18 bindings #756
Conversation
src/ReactDOMServer.re
Outdated
type error = {.}; | ||
|
||
[@bs.module "react-dom/server"] | ||
external renderToPipeableStream: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems wrong. According to the TypeScript type definitions it should be a function of 2 arguments: a ReactNode and an options object:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/f1c7be0bf694f55a4cb8b34bd1134e3d23cf21e7/types/react-dom/server.d.ts#L27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally, I had copied my implementation from server-reason-react and forgot to bind it properly
src/ReactDOMServer.re
Outdated
external renderToPipeableStream: (React.element, options) => string = | ||
"renderToPipeableStream"; | ||
|
||
let renderToPipeableStream = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't most of these be optionally labeled arguments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally, fixed in 8347855
(#756)
Do you want to get this in for the upcoming release? |
4205df5
to
be2cc2f
Compare
@davesnx I took the liberty to rebase this based on the latest changes in main |
be2cc2f
to
4828ec6
Compare
"useTransition"; | ||
|
||
module Experimental: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also include SuspenseList in this module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SuspenseList got unstable by React in facebook/react#27061 and facebook/react#27056 (comment)
I'm fine keeping it but it's very useless
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
We would merge this and release under the 0.14 version! |
Reference https://react.dev/blog/2022/03/29/react-v18
Fixes #742
<SupenseList />
ReactDOM.Server
toReactDOMServer
)React.lazy()
React.Experimental.use