what is the difference between the following two pieces of code, and why one uses ({}) and the other does not use
toggleTodo = id => ({
type: "TOGGLE_TODO",
id
});
toggleToChange = (id)=> {
return {
type: "TOGGLE_TO_CHANGE",
id
}
};
< H1 > question 2 < / H1 >
this.setState({
showPageGroup: showPageGroup,
showPageNumber: showPageNumber,
ellipsisNumber: ellipsisNumber,
endGetIndex: endGetIndex,
arrowShow: arrowShow,
userKeyValue: userKeyValue
})
how does this setState, optimize merging?