使用Mobx时,FlatList的headerView不刷新

2019-08-20  本文已影响0人  sunny635533

使用Mobx时,FlatList的headerView不刷新,

可以尝试用observer包裹headerView,例如:

试过,有效的,但是可能会弹出警告:

Warning: Can't call setState (or forceUpdate) 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. 

上一篇下一篇

猜你喜欢

热点阅读