Destructuring object and ignore one of the results

前端 未结 4 1568
挽巷
挽巷 2020-12-18 18:15

I have:

const section = cloneElement(this.props.children, {
  className: this.props.styles.section,
  ...this.props,
});

Inside this.

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 18:50

    or you can do something like this...

    var newProp = (this.props = {p1, p2,...list out all props except styles});
    

提交回复
热议问题