Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/syntax/src/jsx_v4.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1244,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
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,17 @@ module V4A6 = {
\"SharedPropsWithProps$V4A6"
}
}

module V4A7 = {
type props = {count: int}

let make =
@directive("'use memo'")
props => {
React.int(props.count)
}
let make = {
let \"SharedPropsWithProps$V4A7" = props => make(props)
\"SharedPropsWithProps$V4A7"
}
}
10 changes: 10 additions & 0 deletions tests/syntax_tests/data/ppx/react/sharedPropsWithProps.res
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,13 @@ module V4A6 = {
}
}
}

module V4A7 = {
type props = {count: int}

@react.componentWithProps
let make = @directive("'use memo'")
props => {
React.int(props.count)
}
}
12 changes: 12 additions & 0 deletions tests/tests/src/alias_default_value_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ let C7 = {
make: Alias_default_value_test$C7
};

function make(props) {
'use memo';
return props.count;
}

let Alias_default_value_test$C8 = make;

let C8 = {
make: Alias_default_value_test$C8
};

export {
C0,
C1,
Expand All @@ -90,5 +101,6 @@ export {
C4,
C6,
C7,
C8,
}
/* No side effect */
11 changes: 11 additions & 0 deletions tests/tests/src/alias_default_value_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,14 @@ module C7 = {
React.string(`Hello ${name}, you clicked me ` ++ times)
}
}

module C8 = {
type props = {count: int}

@react.componentWithProps
let make =
@directive("'use memo'")
props => {
React.int(props.count)
}
}
Loading