Scott Kyle c438209718 Fix constant elements hoisted before declarator (#4804)
When multiple declarators are present in a declaration, we want to insert the constant element inside the declaration rather than placing it before because it may rely on a declarator inside that same declaration.
2016-12-03 20:19:32 -08:00

15 lines
274 B
JavaScript

function render() {
const bar = "bar",
_ref = <foo bar={bar} />,
renderFoo = () => _ref;
return renderFoo();
}
function render() {
const bar = "bar",
renderFoo = () => <foo bar={bar} baz={baz} />,
baz = "baz";
return renderFoo();
}