File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
react-scripts/fixtures/kitchensink/src/features/syntax Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 77'use strict' ;
88
99const plugins = [
10+ // Necessary to include regardless of the environment because
11+ // in practice some other transforms (such as object-rest-spread)
12+ // don't work without it: https://github.com/babel/babel/issues/7215
13+ require . resolve ( 'babel-plugin-transform-es2015-destructuring' ) ,
1014 // class { handleClick = () => { } }
1115 require . resolve ( 'babel-plugin-transform-class-properties' ) ,
1216 // The following two plugins use Object.assign directly, instead of Babel's
Original file line number Diff line number Diff line change 1414 "babel-plugin-dynamic-import-node" : " 1.1.0" ,
1515 "babel-plugin-syntax-dynamic-import" : " 6.18.0" ,
1616 "babel-plugin-transform-class-properties" : " 6.24.1" ,
17+ "babel-plugin-transform-es2015-destructuring" : " 6.23.0" ,
1718 "babel-plugin-transform-object-rest-spread" : " 6.26.0" ,
1819 "babel-plugin-transform-react-constant-elements" : " 6.23.0" ,
1920 "babel-plugin-transform-react-jsx" : " 6.24.1" ,
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ export default class extends Component {
4040 return (
4141 < div id = "feature-object-destructuring" >
4242 { this . state . users . map ( user => {
43- const { id, name } = user ;
43+ const { id, ...rest } = user ;
44+ // eslint-disable-next-line no-unused-vars
45+ const [ { name, ...innerRest } ] = [ { ...rest } ] ;
4446 return < div key = { id } > { name } </ div > ;
4547 } ) }
4648 </ div >
You can’t perform that action at this time.
0 commit comments