Object destructuring and immediately return

Viewed 945

Is it correct to destruct props from an object and immediately return it like this: const mapStateToProps = state => ({ ...{ name, phone, shift} = state.employeeForm });

Works pretty fine but my IDE is going mad. Any advice?

2 Answers
Related