Skip to content
RED SAGSkills
medium10 pts · first answer countsreactstateimmutability

Changing an object in state

Clicking Save does not update the screen. Why?

const [user, setUser] = useState({ name: "Asha" })
function rename() {
  user.name = "Asha K"
  setUser(user)
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions