Deconstruction assignment benefits

Use const {state} = this.props;
whether used or let there may be cases where const variable will be changed, for example, while a constant const, but he does not change even if the address data or push obj.name, he does We will complain, he will add this attribute, then the original value was changed. The use of deconstruction assignment does not change the original value.

Guess you like

Origin www.cnblogs.com/zhouyu0001/p/11334702.html