diff --git a/CHANGELOG.md b/CHANGELOG.md index b0aef3bd19..01a231c23d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ - Improve error when using '@deriving(accessors)' on a variant with record arguments. https://github.com/rescript-lang/rescript-compiler/pull/6712 +- Stop escaping JSX prop names with hyphens. https://github.com/rescript-lang/rescript-compiler/pull/6705 + # 11.1.0-rc.7 #### :bug: Bug Fix diff --git a/jscomp/syntax/src/res_printer.ml b/jscomp/syntax/src/res_printer.ml index c7a715f8ce..96541a8d06 100644 --- a/jscomp/syntax/src/res_printer.ml +++ b/jscomp/syntax/src/res_printer.ml @@ -4410,6 +4410,7 @@ and printJsxProps ~state args cmtTbl : Doc.t * Parsetree.expression option = loop [] args and printJsxProp ~state arg cmtTbl = + let printIdentLike ident = printIdentLike ~allowHyphen:true ident in match arg with | ( ((Asttypes.Labelled lblTxt | Optional lblTxt) as lbl), { diff --git a/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt b/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt index d3dc9ecd77..21212ee4a8 100644 --- a/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt +++ b/jscomp/syntax/tests/printer/expr/expected/exoticIdent.res.txt @@ -62,7 +62,7 @@ lazy \"let" let x = 1 let x = -
+
\"module" \"let"
diff --git a/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt b/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt index 8c689a829c..e3912ef814 100644 --- a/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt +++ b/jscomp/syntax/tests/printer/expr/expected/jsx.res.txt @@ -47,6 +47,11 @@ let x = {a} +let x = + + {a} + + let x =
diff --git a/jscomp/syntax/tests/printer/expr/jsx.res b/jscomp/syntax/tests/printer/expr/jsx.res index c86868bc38..a44ecaa71f 100644 --- a/jscomp/syntax/tests/printer/expr/jsx.res +++ b/jscomp/syntax/tests/printer/expr/jsx.res @@ -17,6 +17,7 @@ let x = {a} let x = {a} {b} let x = {a} let x = {a} +let x = {a} let x =