Skip to content

Commit c99aae2

Browse files
committed
fix error message
1 parent 0f31864 commit c99aae2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/syntax/src/jsx_v4.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,12 @@ let transform_structure_item ~config item =
12941294
| _, [_] ->
12951295
Jsx_common.raise_error ~loc:pstr_loc
12961296
"Components cannot be defined as externals when using \
1297-
@react.componentWithProps. Please use @react.component instead."
1297+
@react.componentWithProps.\n\n\
1298+
If you intended to define an external for a React component using a \
1299+
props type,\n\
1300+
use the type React.component<props> instead.\n\
1301+
Alternatively, use @react.component for an external definition with \
1302+
labeled arguments."
12981303
| [_], [] ->
12991304
check_multiple_components ~config ~loc:pstr_loc;
13001305
check_string_int_attribute_iter.structure_item

0 commit comments

Comments
 (0)