File tree 6 files changed +23
-3
lines changed
6 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ module.exports = {
41
41
// Resolve the Babel runtime relative to the config.
42
42
// You can safely remove this after ejecting:
43
43
moduleName : path . dirname ( require . resolve ( 'babel-runtime/package' ) )
44
+ } ] ,
45
+ // Turns JSX into createElement() calls
46
+ [ require . resolve ( 'babel-plugin-transform-react-jsx' ) , {
47
+ pragma : 'createElement' ,
48
+ } ] ,
49
+ // Import react automatically, as need, when JSX is used
50
+ [ require . resolve ( 'babel-plugin-jsx-pragmatic' ) , {
51
+ module : 'react' ,
52
+ import : 'createElement' ,
53
+ export : 'createElement'
44
54
} ]
45
55
]
46
56
} ;
Original file line number Diff line number Diff line change @@ -39,6 +39,16 @@ module.exports = {
39
39
// You can safely remove this after ejecting:
40
40
moduleName : path . dirname ( require . resolve ( 'babel-runtime/package' ) )
41
41
} ] ,
42
+ // Turns JSX into createElement() calls
43
+ [ require . resolve ( 'babel-plugin-transform-react-jsx' ) , {
44
+ pragma : 'createElement' ,
45
+ } ] ,
46
+ // Import react automatically, as need, when JSX is used
47
+ [ require . resolve ( 'babel-plugin-jsx-pragmatic' ) , {
48
+ module : 'react' ,
49
+ import : 'createElement' ,
50
+ export : 'createElement'
51
+ } ]
42
52
// Optimization: hoist JSX that never changes out of render()
43
53
// Disabled because of issues:
44
54
// * https://github.com/facebookincubator/create-react-app/issues/525
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ module.exports = {
190
190
'react/no-deprecated' : 'warn' ,
191
191
'react/no-direct-mutation-state' : 'warn' ,
192
192
'react/no-is-mounted' : 'warn' ,
193
- 'react/react-in-jsx-scope' : 'warn' ,
194
193
'react/require-render-return' : 'warn' ,
195
194
196
195
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
Original file line number Diff line number Diff line change 33
33
"babel-eslint" : " 6.1.2" ,
34
34
"babel-jest" : " 15.0.0" ,
35
35
"babel-loader" : " 6.2.5" ,
36
+ "babel-plugin-jsx-pragmatic" : " 1.0.2" ,
36
37
"babel-plugin-transform-class-properties" : " 6.11.5" ,
37
38
"babel-plugin-transform-object-rest-spread" : " 6.8.0" ,
38
39
"babel-plugin-transform-react-constant-elements" : " 6.9.1" ,
40
+ "babel-plugin-transform-react-jsx" : " 6.8.0" ,
39
41
"babel-plugin-transform-regenerator" : " 6.14.0" ,
40
42
"babel-plugin-transform-runtime" : " 6.15.0" ,
41
43
"babel-preset-latest" : " 6.14.0" ,
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import { Component } from 'react' ;
2
2
import logo from './logo.svg' ;
3
3
import './App.css' ;
4
4
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
1
import ReactDOM from 'react-dom' ;
3
2
import App from './App' ;
4
3
import './index.css' ;
You can’t perform that action at this time.
0 commit comments