Merge pull request #5758 from STRML/test-react-constant-elements-unreferenced-param
Add regression test for transform-react-constant-elements (#5552)
This commit is contained in:
commit
c6eab0c206
@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
|
||||
// Regression test for https://github.com/babel/babel/issues/5552
|
||||
class BugReport extends React.Component {
|
||||
thisWontWork = ({ color }) => (data) => {
|
||||
return <div color={ color }>does not reference data</div>;
|
||||
};
|
||||
|
||||
thisWorks = ({ color }) => (data) => {
|
||||
return <div color={ color }>{ data }</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
return <div />
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
|
||||
// Regression test for https://github.com/babel/babel/issues/5552
|
||||
|
||||
var _ref = <div />;
|
||||
|
||||
class BugReport extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
|
||||
return _temp = super(...args), this.thisWontWork = ({ color }) => data => {
|
||||
return <div color={color}>does not reference data</div>;
|
||||
}, this.thisWorks = ({ color }) => data => {
|
||||
return <div color={color}>{data}</div>;
|
||||
}, _temp;
|
||||
}
|
||||
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-class-properties", "transform-react-constant-elements", "syntax-jsx"]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user