Reputation: 7106
I had a Component with this method :
onRegionChangeComplete = (region) => {
var mapHeight = windowHeight - 124;
var centerCircleLatitude = region.latitude + (mapHeight - windowWidth - (topSize * 2)) * (region.latitudeDelta / (2 * mapHeight));
var centerCircleLongitude = region.longitude;
RestaurantsActions.setRegion(radius, region.longitude, region.latitude, region.longitudeDelta, region.latitudeDelta, centerCircleLongitude, centerCircleLatitude, windowWidth, mapHeight);
this.setState({data: RestaurantsStore.filteredRestaurants()});
this.setState({isChanging : false});
this.setState({index : 0});
this.refs.carousel.goToPage(this.state.index, 'annotationPress');
}
I changed the code above deleting the two last lines to :
onRegionChangeComplete = (region) => {
var mapHeight = windowHeight - 124;
var centerCircleLatitude = region.latitude + (mapHeight - windowWidth - (topSize * 2)) * (region.latitudeDelta / (2 * mapHeight));
var centerCircleLongitude = region.longitude;
RestaurantsActions.setRegion(radius, region.longitude, region.latitude, region.longitudeDelta, region.latitudeDelta, centerCircleLongitude, centerCircleLatitude, windowWidth, mapHeight);
this.setState({data: RestaurantsStore.filteredRestaurants()});
this.setState({isChanging : false});
}
When running react-native bundle, I check the output file and it still has those two lines I deleted. Is there a cache or something remaining ?
My bundle command line :
react-native bundle --dev true --entry-file index.ios.js --bundle-output ios/main.jsbundle --verbose --platform ios
I'm using react-native 0.16.0
Upvotes: 3
Views: 196
Reputation: 7106
OK, I found out, the bundle used a cache version of the packager. I removed it by doing :
rm -f $TMPDIR/react-packager*
Then I re-runnned the bundle command and it worked fine.
Upvotes: 4