SetState - evan-401-advanced-javascript/seattle-javascript-401d31 GitHub Wiki

React uses state which react uses to render UI based on that state. There is only one way to properly change state and react and that is with setState(). If we for example had a button to add an item to a shopping cart we could set the state when the user presses the button like so: setState({ addToCart: event.target.value}). This will start Reacts reconciliation process. React will only update the necessary parts of the DOM which is what makes React so quick.