Skip to content

Conversation

@Freddy03h
Copy link
Collaborator

It seems capureOwnerStack is the only new API in React 19.1 : https://github.com/facebook/react/releases/tag/v19.1.0

📖 captureOwnerStack Documentation

Maybe it's possible to have a release for 19.1 before working on React 19.2 new APIs

@Freddy03h Freddy03h requested a review from cknitt October 20, 2025 11:47
src/React.res Outdated
external act: (unit => promise<unit>) => promise<unit> = "act"

@module("react")
external captureOwnerStack: unit => Js.nullable<string> = "captureOwnerStack"
Copy link
Member

Choose a reason for hiding this comment

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

If I understood the API, it should return or string, so either use a @return or Null.t.

Copy link
Collaborator Author

@Freddy03h Freddy03h Oct 31, 2025

Choose a reason for hiding this comment

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

I didn't know this decorator, thanks!

external act: (unit => promise<unit>) => promise<unit> = "act"

@module("react") @return(nullable)
external captureOwnerStack: unit => option<string> = "captureOwnerStack"
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: add a doc comment with link to https://react.dev/reference/react/captureOwnerStack

@module("react")
external act: (unit => promise<unit>) => promise<unit> = "act"

@module("react") @return(nullable)
Copy link
Member

Choose a reason for hiding this comment

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

Actually @return(null_to_opt) would make the intention clearer as the API can only return string or null according to the docs (but not undefined).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants