From db7efa5e4628e13bf5da28ce90fa0c59d6c9276b Mon Sep 17 00:00:00 2001 From: Freddy Harris Date: Fri, 17 Oct 2025 18:50:13 +0200 Subject: [PATCH 1/4] react 19.1 captureOwnerStack --- package-lock.json | 4 ++-- package.json | 6 +++--- src/React.res | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce2aa29..dfb3292 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "rescript": "^11.0.0" }, "peerDependencies": { - "react": ">=19.0.0", - "react-dom": ">=19.0.0" + "react": ">=19.1.0", + "react-dom": ">=19.1.0" } }, "node_modules/react": { diff --git a/package.json b/package.json index 11c8dda..45994af 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "rescript": "^11.0.0" }, "peerDependencies": { - "react": ">=19.0.0", - "react-dom": ">=19.0.0" + "react": ">=19.1.0", + "react-dom": ">=19.1.0" } -} +} \ No newline at end of file diff --git a/src/React.res b/src/React.res index 0676012..0ed5aed 100644 --- a/src/React.res +++ b/src/React.res @@ -451,3 +451,6 @@ external useOptimistic: ( /** `act` is a test helper to apply pending React updates before making assertions. */ @module("react") external act: (unit => promise) => promise = "act" + +@module("react") +external captureOwnerStack: unit => Js.nullable = "captureOwnerStack" From 9d612c97d59a3164a66ac73226431ab1a3e0b28a Mon Sep 17 00:00:00 2001 From: Freddy Harris Date: Fri, 31 Oct 2025 16:33:45 +0100 Subject: [PATCH 2/4] use return decorator for captureOwnerStack --- src/React.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/React.res b/src/React.res index 0ed5aed..36fcf2a 100644 --- a/src/React.res +++ b/src/React.res @@ -452,5 +452,5 @@ external useOptimistic: ( @module("react") external act: (unit => promise) => promise = "act" -@module("react") -external captureOwnerStack: unit => Js.nullable = "captureOwnerStack" +@module("react") @return(nullable) +external captureOwnerStack: unit => option = "captureOwnerStack" From 2766a12ce9830c4700ea349028dfe1ed564755d4 Mon Sep 17 00:00:00 2001 From: Freddy Harris Date: Sun, 2 Nov 2025 12:10:33 +0100 Subject: [PATCH 3/4] return null_to_opt instead of nullable --- src/React.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/React.res b/src/React.res index 36fcf2a..17f7d6f 100644 --- a/src/React.res +++ b/src/React.res @@ -452,5 +452,5 @@ external useOptimistic: ( @module("react") external act: (unit => promise) => promise = "act" -@module("react") @return(nullable) +@module("react") @return(null_to_opt) external captureOwnerStack: unit => option = "captureOwnerStack" From b386ca8c37935e8d47c7fa36b47761e9302b0951 Mon Sep 17 00:00:00 2001 From: Freddy Harris Date: Sun, 2 Nov 2025 12:16:24 +0100 Subject: [PATCH 4/4] add comment --- src/React.res | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/React.res b/src/React.res index 17f7d6f..da01d2b 100644 --- a/src/React.res +++ b/src/React.res @@ -452,5 +452,7 @@ external useOptimistic: ( @module("react") external act: (unit => promise) => promise = "act" -@module("react") @return(null_to_opt) +/** captureOwnerStack reads the current Owner Stack in development and returns it as a string if available. */ +@module("react") +@return(null_to_opt) external captureOwnerStack: unit => option = "captureOwnerStack"