为什么 React Native 移动应用需要 redux? [英] Why redux is required for React Native mobile App?
问题描述
我是原生 android 应用程序开发人员,但我是 React Native 的入门级开发人员.
I am experience developer of native android app but I am entry level developer for React Native.
我熟悉基本但不明白为什么 Redux 与 React Native 一起使用?
I am familiar with basic but not able to understand why Redux is used with React Native?
我想了解有关使用 java 的 Android Native App 的 Redux 功能
I want understanding of Redux feature in respect to Android Native App using java
推荐答案
Redux 是什么:Redux 是状态管理提供库,由您决定是否使用.但在复杂的应用程序中推荐使用.
What is Redux: Redux is state management provide library and its upto you that you want to use or not. but in the complex apps its recommended for use.
为什么使用:让我们通过例子来理解 - 你点击一个 api 并获取用户数据,你在许多屏幕上都需要它.那么你将如何管理它.
Why Use:lets understand with example- You hit a api and get users data and you need it in many screens.Then how will you manage this.
- 在每个屏幕上点击 api 不是一个好主意,它会使您的应用程序非常慢.
- 通过导航传递数据会使您的导航缓慢而繁重
- 本地存储将难以处理,也会使您的应用程序变慢.
使用 Redux,一旦您将数据存储在 Redux 状态,您就可以在应用中的任何位置访问这些数据,直到您刷新应用.
这篇关于为什么 React Native 移动应用需要 redux?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!