英文:
How to refresh full screen and reload all 3 components in react-native
问题
我有一个应用程序,其中有3个组件,它们的数据都来自API,所有组件的数据都来自API。所有这些组件都被调用到单个屏幕中。我如何在这个单个页面上应用下拉刷新?
我已经尝试了所有预期的方法,但没有找到解决方案。
英文:
I have an app which has 3 components that has data which come from API and all component data come from API. All components are called into a single screen. How can I apply pull to refresh on that single page?
I have done all expected terms but didn't find a solution.
答案1
得分: 1
import { ScrollView } from 'react-native';
> 使用 Scroll View 的 RefreshControl 属性
>
> 这里是一个链接,展示了 RefreshControl 的示例,你可以在 onRefresh 函数中调用 API 更新组件的数据。
[https://reactnative.dev/docs/refreshcontrol][1]
英文:
import { ScrollView } from 'react-native';
> use RefreshControll that is the property of Scroll View
>
> here is the link that shows the example of RefreshControll and you can update the component's data using call api in onRefresh function.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论