prettier applied to all files in src/

This commit is contained in:
dannyrb committed 2019-05-29 08:39:54 -04:00
1 parent 433bb219b0
commit fb7c229b43
69 files changed
+1128 -1116

No files matched your search

+8 -8
View File
@@ -4,34 +4,34 @@
* Link: https://serverless-stack.com/chapters/code-splitting-in-create-react-app.html
*/
import React, { Component } from 'react'
import React, { Component } from 'react';
export default function asyncComponent(importComponent) {
class AsyncComponent extends Component {
constructor(props) {
super(props)
super(props);
this.state = {
component: null,
}
};
}
async componentDidMount() {
// Add dynamically loaded component to state
const { default: component } = await importComponent()
const { default: component } = await importComponent();
this.setState({
component: component,
})
});
}
render() {
const C = this.state.component
const C = this.state.component;
// Render the loaded component, or null
return C ? <C {...this.props} /> : null
return C ? <C {...this.props} /> : null;
}
}
return AsyncComponent
return AsyncComponent;
}