genymotion访问电脑的localhost

用来进行android测试时使用genymotion,genymotion是运行在virtualbox中的,virtualbox为两者建立了连接,在linux下通过ifconfig可以看到有一个叫做vboxnet0的虚拟网卡,ip为192.168.56.1,genymotion中的android分配的地址形如192.168.56.101. read more »

reactnative刷新:DeviceEventEmitter

我在开发中遇到一个问题,这就是你有一个页面A和页面B。有一些数据存储在本地缓存AsyncStorage中。页面B调出AsyncStorage的数据到state中。当我们点击页面A里的按钮来改变AsyncStorage存储的数据时,我希望页面B能够及时更新state。 read more »

setState(…): Cannot update during an existing state

.Warning: setState(…): Cannot update during an existing state transition (such as within render or another component’s constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to componentWillMount。当报这类错误时,说明你的props和states在渲染的时候更改了。 read more »

如何实时更新flatlist数据

很简单,让你的FlatList 使用extraData 属性

通过配置extraData={this.state},FlatList就会当this.state数据发生改变时,更新数据。

微信小程序:返回更新数据

开发中你会遇到需要返回页面,并更新,比如你从A跳转B,B更改了信息,点击左上角返回时,你希望A页面也随之更改,虽然微信有wx.navigateBack()但无法传参。 read more »

第 2 页,共 5 页12345