From 1d9997422c7e78c2796ea3ecac819bdf70be4a5d Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 4 May 2025 17:50:25 +0200 Subject: [PATCH 1/2] Do not error on `ref` as prop --- compiler/syntax/src/jsx_v4.ml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/syntax/src/jsx_v4.ml b/compiler/syntax/src/jsx_v4.ml index febc245f21..fc13cb8235 100644 --- a/compiler/syntax/src/jsx_v4.ml +++ b/compiler/syntax/src/jsx_v4.ml @@ -251,10 +251,6 @@ let rec recursively_transform_named_args_for_make expr args newtypes core_type = Jsx_common.raise_error ~loc:expr.pexp_loc "Key cannot be accessed inside of a component. Don't worry - you can \ always key a component from its parent!" - | Pexp_fun {arg_label = Labelled {txt = "ref"} | Optional {txt = "ref"}} -> - Jsx_common.raise_error ~loc:expr.pexp_loc - "Ref cannot be passed as a normal prop. Please use `forwardRef` API \ - instead." | Pexp_fun {arg_label = arg; default; lhs = pattern; rhs = expression} when is_optional arg || is_labelled arg -> let () = From 9d03c2b1d62d3fa8cfbb9c3811361e3e30f39ade Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 4 May 2025 17:52:58 +0200 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 225b60bfe5..73a41e9d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Add shift (`<<`, `>>`, `>>>`) operators for `int` and `bigint`. https://github.com/rescript-lang/rescript/pull/7183 - Add bitwise AND (`&`) operator for `int` and `bigint`. https://github.com/rescript-lang/rescript/pull/7415 - Significantly reduced the download size by splitting binaries into optional platform-specific dependencies (e.g, `@rescript/linux-x64`). https://github.com/rescript-lang/rescript/pull/7395 +- JSX: do not error on ref as prop anymore (which is allowed in React 19). https://github.com/rescript-lang/rescript/pull/7420 #### :bug: Bug fix