Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
componentDidMount() {
this.RetrieveSellerNo();
this.requestLocationPermission();
this.requestData();
this.Watch();
this._interval = setInterval(() => {
if (this.state.SellerNo !== null) {
this.uploadPosition();
}
this.requestData();
}, 60000);
setTimeout(() => {
this.requestData();
this.StoreiposLat();
this.StoreiposLong();
}, 5000);
}
componentWillUnmount = () => {
Geolocation.clearWatch(this.watchId);
}
Watch = () => {
this.watchId = Geolocation.watchPosition(
(position) => {
this.setState({
watch: {
lat: position.coords.latitude,
long: position.coords.longitude
}
});
},
(error) => {
// console.log(error.message)
},
{ enableHighAccuracy: false, timeout: 20000, maximumAge: 1000, } //distanceFilter:1
);
}