What does the ...
do in this React (using JSX) code and what is it called?
As you know ...
are called Spread Attributes which the name represents it allows an expression to be expanded.
var parts = ['two', 'three'];
var 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:
var person= {
name: 'Alex',
age: 35
}
This:
is equal to
So in short, it's a neat short-cut, we can say.