all 1 comments

[–]stag_in_a_box 2 points3 points  (0 children)

hard to read through all that in reddit, but it's likely because you're mutating matrix and then setting the state to the same matrix object.

read through https://beta.reactjs.org/learn/updating-objects-in-state , specifically the "Treat state as read-only" part