fix binding kind of destructured variables. (#4813)
Fixes #4516 and any other code that hoists into a scope where function params are destructured.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
function render({ text, className, id }) {
|
||||
return () => (<Component text={text} className={className} id={id} />);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
function render(_ref) {
|
||||
let text = _ref.text,
|
||||
className = _ref.className,
|
||||
id = _ref.id;
|
||||
|
||||
var _ref2 = <Component text={text} className={className} id={id} />;
|
||||
|
||||
return () => _ref2;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
|
||||
"plugins": ["transform-es2015-destructuring", "transform-es2015-parameters", "transform-react-constant-elements", "syntax-jsx"]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
function render({ text, className, id, ...props }) {
|
||||
// intentionally ignoring props
|
||||
return () => (<Component text={text} className={className} id={id} />);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
||||
|
||||
function render(_ref) {
|
||||
let text = _ref.text,
|
||||
className = _ref.className,
|
||||
id = _ref.id,
|
||||
props = _objectWithoutProperties(_ref, ["text", "className", "id"]);
|
||||
|
||||
var _ref2 = <Component text={text} className={className} id={id} />;
|
||||
|
||||
// intentionally ignoring props
|
||||
return () => _ref2;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
|
||||
"plugins": ["transform-es2015-destructuring", "transform-es2015-parameters",
|
||||
"transform-es2015-spread", "syntax-object-rest-spread",
|
||||
"transform-react-constant-elements", "syntax-jsx"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render({ text, className, id, ...props }) {
|
||||
return () => (<Component text={text} className={className} id={id} {...props} />);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
||||
|
||||
function render(_ref) {
|
||||
let text = _ref.text,
|
||||
className = _ref.className,
|
||||
id = _ref.id,
|
||||
props = _objectWithoutProperties(_ref, ["text", "className", "id"]);
|
||||
|
||||
return () => <Component text={text} className={className} id={id} {...props} />;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
|
||||
"plugins": ["transform-es2015-destructuring", "transform-es2015-parameters",
|
||||
"transform-es2015-spread", "syntax-object-rest-spread",
|
||||
"transform-react-constant-elements", "syntax-jsx"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render({ text }) {
|
||||
return () => (<Component text={text} />);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render(_ref) {
|
||||
let text = _ref.text;
|
||||
|
||||
var _ref2 = <Component text={text} />;
|
||||
|
||||
return () => _ref2;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
|
||||
"plugins": ["transform-es2015-destructuring", "transform-es2015-parameters", "transform-react-constant-elements", "syntax-jsx"]
|
||||
}
|
||||
Reference in New Issue
Block a user