What is the correct way of updating state, is a nested object, in React with Hooks?
export Example = () => {
const [exampleState, setExampleState] = use
I think best solution is Immer. It allows you to update object like you are directly modifying fields (masterField.fieldOne.fieldx = 'abc'). But it will not change actual object of course. It collects all updates on a draft object and gives you a final object at the end which you can use to replace original object.