What is the meaning of {…this.props} in Reactjs

前端 未结 5 2007
南笙
南笙 2020-12-07 08:32

What is the meaning of

{...this.props}

I am trying to use it like that

 
Content Here
5条回答
  •  再見小時候
    2020-12-07 08:50

    It will compile to this:

    React.createElement('div', this.props, 'Content Here');
    

    As you can see above, it passes all it's props to the div.

提交回复
热议问题