Skip to content

Commit 021839a

Browse files
committed
Fix issue where create interface file would not work with certain JSX V4 components
1 parent 6e199ef commit 021839a

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
- Fix file location in Document Symbols response. https://github.com/rescript-lang/rescript-vscode/issues/629
3333

34+
- Fix issue where create interface file would not work with certain JSX V4 components https://github.com/rescript-lang/rescript-vscode/issues/617
35+
3436
## v1.8.2
3537

3638
#### :rocket: New Feature

analysis/src/CreateInterface.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,7 @@ let printSignature ~extractor ~signature =
246246
:: Sig_value (makeId (* make *), makeValueDesc)
247247
:: rest
248248
when Ident.name propsId = "props"
249-
&& getComponentTypeV4 makeValueDesc.val_type <> None
250-
&&
251-
match recordRepresentation with
252-
| Record_optional_labels _ -> true
253-
| _ -> labelDecls = [] (* empty record *) ->
249+
&& getComponentTypeV4 makeValueDesc.val_type <> None ->
254250
(* PPX V4 component declaration:
255251
type props = {...}
256252
let v = ...

analysis/tests/src/expected/JsxV4.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module MM: {
2626
let make: unit => React.element
2727
}
2828
module Other: {
29-
type props<'name> = {name: 'name}
30-
let make: props<string> => React.element
29+
@react.component
30+
let make: (~name: string) => React.element
3131
}
3232

0 commit comments

Comments
 (0)