- 
                Notifications
    
You must be signed in to change notification settings  - Fork 44
 
React 19.1 captureOwnerStack #146
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?
Conversation
        
          
                src/React.res
              
                Outdated
          
        
      | external act: (unit => promise<unit>) => promise<unit> = "act" | ||
| 
               | 
          ||
| @module("react") | ||
| external captureOwnerStack: unit => Js.nullable<string> = "captureOwnerStack" | 
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.
If I understood the API, it should return null or string, so either use a @return or Null.t.
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.
I didn't know this decorator, thanks!
cddbda2    to
    9d612c9      
    Compare
  
    | external act: (unit => promise<unit>) => promise<unit> = "act" | ||
| 
               | 
          ||
| @module("react") @return(nullable) | ||
| external captureOwnerStack: unit => option<string> = "captureOwnerStack" | 
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.
Nitpick: add a doc comment with link to https://react.dev/reference/react/captureOwnerStack
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.
Is there a way to format it? I don't see any other comment with link to the react doc.
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.
Doesn't mean you shouldn't add it.
Try something like /** url */
        
          
                src/React.res
              
                Outdated
          
        
      | @module("react") | ||
| external act: (unit => promise<unit>) => promise<unit> = "act" | ||
| 
               | 
          ||
| @module("react") @return(nullable) | 
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.
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).
It seems
capureOwnerStackis 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