Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 为每个onChangeText更新TextInput的redux状态是一种好的做法吗_Reactjs_React Native_Redux - Fatal编程技术网

Reactjs 为每个onChangeText更新TextInput的redux状态是一种好的做法吗

Reactjs 为每个onChangeText更新TextInput的redux状态是一种好的做法吗,reactjs,react-native,redux,Reactjs,React Native,Redux,我也是React Native和redux的新手。但不知怎么的,他们开始做应用程序了。所以我的问题是,我是否需要为任何文本输入组件的每次文本更改更新redux的状态。您的类组件中可以有一个本地状态。因此,无论何时更改文本,都可以影响本地状态。 提交文本后,可以将其存储在redux状态

我也是React Native和redux的新手。但不知怎么的,他们开始做应用程序了。所以我的问题是,我是否需要为任何文本输入组件的每次文本更改更新redux的状态。

您的类组件中可以有一个本地状态。因此,无论何时更改文本,都可以影响本地状态。 提交文本后,可以将其存储在redux状态