react里这句是什么意思,为啥这么写呢const { component: Component, ...rest } = this.props;

2025-05-08 23:01:29
推荐回答(2个)
回答1:

es6写法相当于
var component = this.props.Component;
var props的其他属性=this.props的属性值

回答2:

其实就相当于 {post} = this.props