Skip to content

Commit

Permalink
Copy attributes from function
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Feb 17, 2025
1 parent 7c0af6e commit 65c2bf2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compiler/syntax/src/jsx_v4.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
in
(Some props_record_type, binding, new_binding))
else if Jsx_common.has_attr_on_binding Jsx_common.has_attr_with_props binding
then (
then
let modified_binding =
{
binding with
Expand All @@ -1198,8 +1198,6 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
make_module_name file_name config.nested_modules fn_name
in

Format.printf "Yow %s\n" full_module_name;

let is_async =
Ast_async.dig_async_payload_from_function modified_binding.pvb_expr
in
Expand Down Expand Up @@ -1246,6 +1244,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =

let wrapper_expr =
Exp.fun_ ~arity:None Nolabel None props_pattern
~attrs:binding.pvb_expr.pexp_attributes
(Jsx_common.async_component ~async:is_async
(Exp.apply
(Exp.ident
Expand Down Expand Up @@ -1285,7 +1284,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
binding with
pvb_attributes = binding.pvb_attributes |> List.filter other_attrs_pure;
},
new_binding ))
new_binding )
else (None, binding, None)

let transform_structure_item ~config item =
Expand Down

0 comments on commit 65c2bf2

Please sign in to comment.