I have an object like this in json:
let state = {
authenticationObj: {
"isAuthenticating": true, "isAuthentic": false, "subscriberId": "NA", "username": "NA",
"firstName": "NA", "lastName": "NA", "enabled": "1", "email": "NA", isAuthorized: false
}, lastPasswordCheckStatus:undefined }
Now I want to just change an item in authenticationObj lets say email. I know I should use ... so if I was going to change lastPasswordCheckStatus I would do it this way:
state = {
...state,
lastPasswordCheckStatus: action.payload.lastPasswordCheckStatus
}
So far so good. But how can I change the email inside authenticationObj and keep all the other attributes value such as lastPasswordCheckStatus and firstname and etc?