Eslint prefer-object-spread (#9466)

* The rule.

* The result
This commit is contained in:
Evan Rusackas
2020-04-03 17:05:16 -07:00
committed by GitHub
parent 265a2feb29
commit 1cdfb829d7
29 changed files with 211 additions and 266 deletions

View File

@@ -75,11 +75,10 @@ class ControlPanelsContainer extends React.Component {
}
// Applying mapStateToProps if needed
if (mapF) {
return Object.assign(
{},
control,
mapF(this.props.exploreState, control, this.props.actions),
);
return {
...control,
...mapF(this.props.exploreState, control, this.props.actions),
};
}
return control;
}

View File

@@ -418,13 +418,12 @@ function mapStateToProps(state) {
}
function mapDispatchToProps(dispatch) {
const actions = Object.assign(
{},
exploreActions,
saveModalActions,
chartActions,
logActions,
);
const actions = {
...exploreActions,
...saveModalActions,
...chartActions,
...logActions,
};
return {
actions: bindActionCreators(actions, dispatch),
};

View File

@@ -88,9 +88,10 @@ export default class ColorPickerControl extends React.Component {
}
render() {
const c = this.props.value || { r: 0, g: 0, b: 0, a: 0 };
const colStyle = Object.assign({}, styles.color, {
const colStyle = {
...styles.color,
background: `rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,
});
};
return (
<div>
<ControlHeader {...this.props} />