Skip to content

Commit 6ecf507

Browse files
committed
added async function support with babel plugin proposal class props and regen runtime
1 parent 953f4f9 commit 6ecf507

File tree

5 files changed

+34
-46
lines changed

5 files changed

+34
-46
lines changed

.babelrc

+7
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@
22
"presets": [
33
"@babel/preset-env",
44
"@babel/preset-react"
5+
],
6+
"plugins": [
7+
[
8+
"@babel/plugin-proposal-class-properties", {
9+
"regenerator": true
10+
}
11+
]
512
]
613
}

package-lock.json

+13-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333
"webpack-visualizer-plugin": "^0.1.11"
3434
},
3535
"dependencies": {
36+
"@babel/plugin-proposal-class-properties": "^7.10.4",
3637
"express": "^4.17.1",
3738
"install": "^0.13.0",
3839
"npm": "^6.14.8",
3940
"react": "^16.13.1",
40-
"react-dom": "^16.13.1"
41+
"react-dom": "^16.13.1",
42+
"regenerator-runtime": "^0.13.7"
4143
}
4244
}

src/components/pinterestGrid.js

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ const photos = [
1010
]
1111

1212
class PinterestGrid extends Component {
13+
14+
constructor() {
15+
super()
16+
17+
const asyncTest = async () => {
18+
19+
}
20+
21+
asyncTest()
22+
}
1323
render() {
1424
const { title } = this.props;
1525
return (

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'regenerator-runtime/runtime'
12
import Layout from './components/layout';
23

34
import './style/main.scss';

0 commit comments

Comments
 (0)