JSTQL-JS-Transform/output_testing/1118useMemo-if-else-multiple-return.js

9 lines
No EOL
186 B
JavaScript

function Component(props) {
const x = (() => {
if (props.cond) {
return props.a |> makeObject(%);
}
return props.b |> makeObject(%);
}) |> useMemo(%);
return x;
}