Reactjs.
<div> <h1>{greeting.greet}, {greeting.place}</h1> <button onClick={updateGreeting}>Update greeting</button> </div> ); } The reason this works is because it uses the previous state, which is named prevState, and this is the previous value of the greeting variable. In other words, it makes a copy of