I have an object like this
this.currentRegion = {
latitude: 25.3170013,
longitude: 55.4748285,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
};
and another object
coords = {
accuracy: 20,
altitude: 5,
heading: 0,
latitude: 25.380599999999998,
longitude: 55.3992,
speed: 0,
}
I need
this.currentRegion = {
latitude: 25.380599999999998,
longitude: 55.3992,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
}
I tried this.currentRegion = Object.assign(this.currentRegion, region.coords);
and got the error
Attempting to set key on an object that is immutable and has been frozen