Splice an array in React keeps rerendering
In the update(changeProps) function, I have something like this: update(changedProps) { if (this.person) { this.__arr = [‘hi’, ‘hi’, ‘hi’]; } else { this.__arr = [‘bye’, ‘bye’, ‘bye’, ‘bye’]; } if (this.__hello) { this.__arr.splice(1, 0, ‘hello’); } super.update(changedProps); } Say this.person is true, when I click elsewhere and the page rerenders, it becomes this.__arr = [‘hi’,… Read More Splice an array in React keeps rerendering