Why not just use Object.assign()
?
return Object.assign({}, this.props);
That'll build a new empty object and then copy all the enumerable properties from this.props
into it. The target object is returned by Object.assign()
so it pretty much does all the work.