How to declare a new state in react using useState hook? Assuming we use functional components in this whole journey.
How to update state?
State accepts any type of data from strings, booleans, arrays, objects, numbers etc, how to update a single key in an object while leaving other keys unaffected? How to update array data( adding or removing an item in an array)?
Assume array of objects is passes as a state, how to update a single key in a single object of an array without affecting other keys of a particular object and without affecting other objects in the array?
How to declare a new state in react using useState hook? Assuming we use functional components in this whole journey.
How to update state?
State accepts any type of data from strings, booleans, arrays, objects, numbers etc, how to update a single key in an object while leaving other keys unaffected? How to update array data( adding or removing an item in an array)?
Assume array of objects is passes as a state, how to update a single key in a single object of an array without affecting other keys of a particular object and without affecting other objects in the array?