hello, thanks for this wonderful tutorial
can you tell me what's the difference in setCell function between :
this.data = [ ...this.data.slice(0, rowI), [ ...this.data[rowI].slice(0, cellI), newContent, ...this.data[rowI].slice(cellI + 1), ], ...this.data.slice(rowI + 1), ]
And
this.data[rowI][cellI] = newContent
Hi Bessem!
The second one mutates the array, while the first one creates a brand new one. See reactjs.org/docs/state-and-lifecyc...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hello, thanks for this wonderful tutorial
can you tell me what's the difference in setCell function between :
And
Hi Bessem!
The second one mutates the array, while the first one creates a brand new one. See reactjs.org/docs/state-and-lifecyc...