React本机包更改未考虑在内 [英] React native bundle changes not taken in account
本文介绍了React本机包更改未考虑在内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用此方法的组件:
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});
}
运行react-native bundle时,我检查输出文件,它仍然有我删除了那两行。是否有缓存或剩余的东西?
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 ?
我的捆绑命令行:
react-native bundle --dev true --entry-file index.ios.js --bundle-output ios/main.jsbundle --verbose --platform ios
我正在使用react-native 0.16.0
I'm using react-native 0.16.0
推荐答案
好的,我发现,捆绑包使用了打包器的缓存版本。我通过这样做删除了它:
OK, I found out, the bundle used a cache version of the packager. I removed it by doing :
rm -f $TMPDIR/react-packager*
然后我重新运行了bundle命令,它工作正常。
Then I re-runnned the bundle command and it worked fine.
这篇关于React本机包更改未考虑在内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文