In React, what do the three points ... do?

Updated: Nov 1, 2019

As you are conscious, The Spread attributes (...) that the name indicates allow expansion of a word.


Let's have a real example:

Suppose we have object like below:

var student= {
    name: 'Honey',
    age: 35 

By using The spread attribute (...) we can use this object as below:

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

which is equivalent to :

<Modal name={} age={student.age} title='Modal heading' animation={false} />


So in short, it's a neat short-cut, that's all !!

Never Miss a Post. Subscribe Now!

Contact Us:

Location : Bangalore India.

© 2019 proudly created  by Nawab Ahmad. 

  • Nawab Ahmad
  • Grey Twitter Icon
  • Nawab Ahmad