Skip to content

Commit 80c96a1

Browse files
authored
Do not error on ref as prop (#7420)
* Do not error on `ref` as prop * CHANGELOG
1 parent 135f3b2 commit 80c96a1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Add shift (`<<`, `>>`, `>>>`) operators for `int` and `bigint`. https://github.com/rescript-lang/rescript/pull/7183
2323
- Add bitwise AND (`&`) operator for `int` and `bigint`. https://github.com/rescript-lang/rescript/pull/7415
2424
- 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
25+
- JSX: do not error on ref as prop anymore (which is allowed in React 19). https://github.com/rescript-lang/rescript/pull/7420
2526

2627
#### :bug: Bug fix
2728

compiler/syntax/src/jsx_v4.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,6 @@ let rec recursively_transform_named_args_for_make expr args newtypes core_type =
251251
Jsx_common.raise_error ~loc:expr.pexp_loc
252252
"Key cannot be accessed inside of a component. Don't worry - you can \
253253
always key a component from its parent!"
254-
| Pexp_fun {arg_label = Labelled {txt = "ref"} | Optional {txt = "ref"}} ->
255-
Jsx_common.raise_error ~loc:expr.pexp_loc
256-
"Ref cannot be passed as a normal prop. Please use `forwardRef` API \
257-
instead."
258254
| Pexp_fun {arg_label = arg; default; lhs = pattern; rhs = expression}
259255
when is_optional arg || is_labelled arg ->
260256
let () =

0 commit comments

Comments
 (0)