我们使用FlatList来完成一行两列的渲染 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
如何用setState更新数组中的某个元素
如何用setState更新数组中的某个元素,下面思路搞定: read more
如何实时更新flatlist数据
很简单,让你的FlatList 使用extraData
属性
通过配置extraData={this.state},FlatList就会当this.state数据发生改变时,更新数据。
react-native-button 使用详解
很不错的button组件 read more
介绍一个很不错的弹层插件react-native-modalbox
今天介绍一个很不错的弹出层插件,他可以完成底部弹出并悬浮底部,顶部弹出并悬浮顶部,悬浮中部等位置,而且里面的内容我们可以定制,非常的好。 read more
微信小程序:返回更新数据
开发中你会遇到需要返回页面,并更新,比如你从A跳转B,B更改了信息,点击左上角返回时,你希望A页面也随之更改,虽然微信有wx.navigateBack()但无法传参。 read more
react-native固定吸顶navBar和底部tabBar
你会发现react-native没有fixed,那么怎么才能将元素,固定吸顶和底部呢? read more
react native 7 flatlist
今天我们要获取全部产品,并用flatlist展示他们。
read more