加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

What does the three dots in react do?

发布时间:2020-12-15 07:35:08 所属栏目:百科 来源:网络整理
导读:http://stackoverflow.com/a/41640566/2177408 As you know ... are called spread operator which the name represents it allows an expression to be expanded. var parts = [ 'two' , 'three' ]; numbers 'one' ... parts 'four' 'five' // ["one","two"

http://stackoverflow.com/a/41640566/2177408

As you know...are calledspread operatorwhich the name represents it allows an expression to be expanded.

var parts = ['two', 'three'];  numbers 'one'...parts'four''five' // ["one","two","three","four","five"]

And in this case(I'm gonna simplify it).

//just assume we have an object like this: person{ name:'Alex' age 35}

This:

<Modal {...person} title='Modal heading' animation{false} />

is equal to

name{person.name}age{person.age} So in short,it's aneatshort-cut,we can say.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读