today I encountered that it is impossible to set state in react native using old state value and then utilizing spread operator like this:
setSomeValue(oldValue => {...oldValue, someField: 'newValue'})
it is necessary to add parentheses:
setSomeValue(oldValue => ({...oldValue, someField: 'newValue'}))
and then everything works just fine.
What is the reason?