Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 6bd69fb

Browse files
mununkicristianoc
authored andcommitted
remove key prop from interface
1 parent cfb349a commit 6bd69fb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

cli/reactjs_jsx_ppx.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,10 +2524,9 @@ module V4 = struct
25242524
in
25252525
let propsRecordType =
25262526
makePropsRecordTypeSig "props" Location.none
2527-
([(true, "key", [], keyType Location.none)]
2528-
(* If there is Nolabel arg, regard the type as ref in forwardRef *)
2529-
@ (if !hasForwardRef then [(true, "ref", [], refType Location.none)]
2530-
else [])
2527+
((* If there is Nolabel arg, regard the type as ref in forwardRef *)
2528+
(if !hasForwardRef then [(true, "ref", [], refType Location.none)]
2529+
else [])
25312530
@ namedTypeList)
25322531
in
25332532
(* can't be an arrow because it will defensively uncurry *)

tests/ppx/react/Interface.resi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@react.component
2+
let make: (~x:string) => React.element
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
type props<'x> = {x: 'x}
2+
let make: React.componentLike<props<string>, React.element>

0 commit comments

Comments
 (0)