Skip to content

Commit 226fd21

Browse files
committed
fix alias props to any case in jsx v4
1 parent 7083664 commit 226fd21

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

res_syntax/src/reactjs_jsx_v4.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,10 +1103,7 @@ let transformStructureItem ~config mapper item =
11031103
| Pexp_fun
11041104
( _arg_label,
11051105
_default,
1106-
{
1107-
ppat_desc =
1108-
Ppat_construct ({txt = Lident "()"}, _) | Ppat_any;
1109-
},
1106+
{ppat_desc = Ppat_construct ({txt = Lident "()"}, _)},
11101107
expr ) ->
11111108
(patternsWithLabel, patternsWithNolabel, expr)
11121109
| Pexp_fun

res_syntax/tests/ppx/react/expected/aliasProps.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module C0 = {
77
}
88

99
@react.component
10-
let make = (_: props<'priority, 'text>) => {
10+
let make = ({priority: _, ?text, _}: props<'priority, 'text>) => {
1111
let text = switch text {
1212
| Some(text) => text
1313
| None => "Test"
1414
}
1515

16-
(~text="Test") => React.string(text)
16+
React.string(text)
1717
}
1818
let make = {
1919
let \"AliasProps$C0" = (props: props<_>) => make(props)

0 commit comments

Comments
 (0)