[英]How to map state to props in redux in react native
Hi I am reading this tutorial https://www.packtpub.com/books/content/how-get-started-redux-react-native where guy explained about use case of redux
in react native application. 嗨,我正在阅读本教程https://www.packtpub.com/books/content/how-get-started-redux-react-native ,其中man解释了
redux
在本机应用程序中的用例。 Well, I gotcha things there, but I see that 好吧,我在那里找到了东西,但我明白了
userReducers
is not defined there in class Login.js I am not sure where it is being referenced. userReducers
中没有定义userReducers我不确定它被引用的位置。
Can anyone help me what is that ? 任何人都可以帮助我这是什么? Shouldn't it
state.user
instead user.userReducers.user
不应该是
state.user
而不是user.userReducers.user
This is because in your index.ios.js file while creating the redux store, you are name-spacing this data under userReducers
. 这是因为在创建redux存储时,在index.ios.js文件中,您将在
userReducers
下对此数据进行名称间隔。
According to line 10 where you are creating the store, all state variables added by userReducers
will be available under state.userReducers
. 根据您创建商店的第10行,
userReducers
添加的所有状态变量都将在state.userReducers
下state.userReducers
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.