In this tutorial we are going to learn about what is a spread operator and how to handle objects using useState.
Here we can initialize myName, myAge, Degree. All these values are the current value of myObject .
Here also we can create a function that is ChangeObject which generates an updated value which is setMyObject. Here we only want to change the myName value by using “ … ” these three dots we can only change one value. Which is define inside the function
(myName: “mern developer”).
Output:-
0 Comments