This week I learnt...

This week I learnt...

Updating a state hook object

Jul 31, 20211 min read

You might want your state hook to be an object. Which is fine, it can absolutely be one. const [state, setState = useState({ language: 'React', proficiency: 'confused' }); The trouble comes when you try to update it. You might think you c...