setState vs replaceState in React.js
问题 I am new to React.js Library and I was going over some of the tutorials and I came across: this.setState this.replaceState The Description given is not very clear (IMO). setState is done to 'set' the state of a value, even if its already set in the 'getInitialState' function. Similarly, The replaceState() method is for when you want to clear out the values already in state, and add new ones. I tried this.setState({data: someArray}); followed by this.replaceState({test: someArray}); and then