Skip to content

Commit 65c2bf2

Browse files
committed
Copy attributes from function
1 parent 7c0af6e commit 65c2bf2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/syntax/src/jsx_v4.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
11851185
in
11861186
(Some props_record_type, binding, new_binding))
11871187
else if Jsx_common.has_attr_on_binding Jsx_common.has_attr_with_props binding
1188-
then (
1188+
then
11891189
let modified_binding =
11901190
{
11911191
binding with
@@ -1198,8 +1198,6 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
11981198
make_module_name file_name config.nested_modules fn_name
11991199
in
12001200

1201-
Format.printf "Yow %s\n" full_module_name;
1202-
12031201
let is_async =
12041202
Ast_async.dig_async_payload_from_function modified_binding.pvb_expr
12051203
in
@@ -1246,6 +1244,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
12461244

12471245
let wrapper_expr =
12481246
Exp.fun_ ~arity:None Nolabel None props_pattern
1247+
~attrs:binding.pvb_expr.pexp_attributes
12491248
(Jsx_common.async_component ~async:is_async
12501249
(Exp.apply
12511250
(Exp.ident
@@ -1285,7 +1284,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
12851284
binding with
12861285
pvb_attributes = binding.pvb_attributes |> List.filter other_attrs_pure;
12871286
},
1288-
new_binding ))
1287+
new_binding )
12891288
else (None, binding, None)
12901289

12911290
let transform_structure_item ~config item =

0 commit comments

Comments
 (0)