File tree 3 files changed +11
-20
lines changed
3 files changed +11
-20
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"presets" : [
3
- [
4
- " es2015" ,
5
- {
6
- "modules" : false
7
- }
8
- ],
9
- " react" ,
10
- " stage-0"
11
- ],
12
- "env" : {
13
- "start" : {
14
- "presets" : [" react-hmre" ]
15
- },
16
- "test" : {
17
- "presets" : [" es2015" , " react" , " stage-0" ]
18
- }
19
- }
3
+ " env" ,
4
+ " react"
5
+ ]
20
6
}
Original file line number Diff line number Diff line change 5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
7
"prepublish" : " babel ./src --out-dir ./lib --plugins=transform-class-properties,transform-react-jsx --presets=env" ,
8
- "test" : " jest"
8
+ "test" : " BABEL_ENV=test jest"
9
9
},
10
10
"repository" : {
11
11
"type" : " git" ,
32
32
"babel-cli" : " ^6.26.0" ,
33
33
"babel-core" : " ^6.26.0" ,
34
34
"babel-eslint" : " ^6.1.2" ,
35
- "babel-jest" : " ^22.4.1 " ,
35
+ "babel-jest" : " ^22.4.3 " ,
36
36
"babel-loader" : " ^7.1.2" ,
37
37
"babel-plugin-transform-class-properties" : " ^6.24.1" ,
38
38
"babel-plugin-transform-react-jsx" : " ^6.24.1" ,
52
52
"react" : " ^15.5.4" ,
53
53
"react-dom" : " ^15.5.4" ,
54
54
"react-test-renderer" : " ^16.2.0" ,
55
+ "regenerator-runtime" : " ^0.11.1" ,
55
56
"webpack" : " ^3.6.0" ,
56
57
"webpack-dev-server" : " ^2.9.1"
57
58
},
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ import hljs from 'highlight.js';
2
2
import React from 'react' ;
3
3
4
4
class Highlight extends React . Component {
5
+ constructor ( props ) {
6
+ super ( props )
7
+ this . setEl = this . setEl . bind ( this )
8
+ }
5
9
componentDidMount ( ) {
6
10
this . highlightCode ( ) ;
7
11
}
@@ -18,7 +22,7 @@ class Highlight extends React.Component {
18
22
}
19
23
}
20
24
21
- setEl = ( el ) => {
25
+ setEl ( el ) {
22
26
this . el = el ;
23
27
} ;
24
28
You can’t perform that action at this time.
0 commit comments