腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
2
回答
使用
CombineReducers
时
状态
未定义
、
、
目前我已经将我的reducers一分为二,并
使用
combineReducers
将它们组合在一起。奇怪的是,当我的应用程序运行时,state是
未定义
的(我正在记录this.props,但没有任何内容有值。 我可以看到
使用
redux-devtools分派操作,但它就是不起作用。正如前面提到的,不
使用
combinedReducers可以解决这个问题。}) export default reducer; 当应用程序加载
时
,我期望{term:"initial term",se
浏览 17
提问于2019-04-03
得票数 0
回答已采纳
4
回答
为什么redux reducer变得“
未定义
”,而不是初始
状态
?
、
、
然而,在reducers内部,
状态
是undefined。为什么?!customData = (customData: any, action: any): any => {}所以我显式地给出了一个初始
状态
,但是redux会用undefined调用reducers我知道我可以将初始
状态
浏览 0
提问于2018-10-27
得票数 6
2
回答
使用
combineReducers
()组合两个减速器
时
出错
、
、
、
store.tsx:root.reducers.tsx: mainReducer, profileReducersexport default profileReducers;
浏览 2
提问于2022-09-10
得票数 2
回答已采纳
3
回答
使用
combineReducers
()
时
未定义
的
状态
、
、
当我想把我的2台减速器组合起来的时候,我无法得到我的
状态
。 return state;} import {
combineReducers
/categories-reducer'; expo
浏览 6
提问于2020-06-12
得票数 0
回答已采纳
3
回答
我在下面的react-redux代码中遇到初始化错误
、
我收到以下错误: Reducer "counter“在初始化期间返回
未定义
的
状态
如果传递给reducer的
状态
是
未定义
的,则必须显式返回初始
状态
。初始
状态
不能是
未定义
的。如果您不想为此缩减程序设置值,则可以
使用
null代替undefined。当我尝试合并两个减速机时,这个错误就来了。import counterReducer from "./isLogged" import {
combineRedu
浏览 1
提问于2019-07-25
得票数 2
1
回答
将Redux
状态
重置为undefined或initial
状态
(一个
状态
除外
、
我有一个redux存储,其中我
使用
combineReducers
定义了所有的应用程序。我想要实现的是,当用户注销
时
,我想将除一个
状态
外的所有
状态
重置为
未定义
状态
。下面的例子运行良好,但是如果我有8个以上的
状态
,我会有很长的代码。有没有方法可以简化这一过程,也许是遍历appReducers?: num1,
浏览 18
提问于2020-02-15
得票数 0
回答已采纳
1
回答
Redux reducer返回
未定义
的错误,即使它被初始化为null
、
在selectedSongReducer中,selectedSong被定义为null,因此它不会返回错误,但我仍然得到以下错误:错误: Reducer "selectedSong“在初始化期间返回
未定义
如果传递给缩减程序的
状态
未定义
,则必须显式返回初始
状态
。初始
状态
不能是
未定义
的。如果您不想为此缩减程序设置值,则可以
使用
null代替undefined。以下是reducer代码: import {
combineReducers
} from
浏览 41
提问于2021-04-07
得票数 0
3
回答
React :无法在
使用
combineReducers
后映射
状态
、
、
数据的
状态
为:{items: data here }。当我在顶层减速机文件上写还原器
时
,我可以映射这些项目。但是,如果我
使用
combineReducers
,它会让我错误地说"this.props.items是
未定义
的:返回this.props.items.slice(0,20).map(item => )“。state = INITIAL_STATE, action) => {} 减速器#
浏览 0
提问于2019-07-25
得票数 0
回答已采纳
3
回答
响应键"mods“的片减缩器,在初始化过程中返回
未定义
的。(redux)
、
、
reducers/index.jsimport mods from "./mods.js"; modsreducers/mods.js}} 不知道为什么会这样,我做过类似的事情,但从来没有遇到过这个问题,我是新来的,所以这
浏览 2
提问于2021-08-09
得票数 3
回答已采纳
1
回答
未定义
TypeError:无法读取
未定义
的属性“uid”
、
、
使用
reactjs、firebase (google )、react路由器和redux设置身份验证。<PrivateRoute path="/create" compone
浏览 1
提问于2018-03-16
得票数 1
回答已采纳
1
回答
Warning.js?6327:33警告:<provider>标记上的属性`store`未知
、
、
但是每当我尝试
使用
combineReducers
({})组合它们
时
,我的道具变得
未定义
,并且我的
状态
:(来自store.getState())原来是两个以我的reducers命名的对象。
浏览 0
提问于2019-08-23
得票数 0
1
回答
导航后
未定义
React本机Redux useSelector
、
、
、
、
导航到另一个
状态
后,我无法获取更新的
状态
。我想
使用
我的dataState,它是在reducer中初始化的,并通过action更新。我在分派之后在屏幕1上
使用
了这个
状态
,但当我导航到另一个屏幕
时
,它返回
未定义
。'; type: DATA_AVAILABLE,});import {
combineReducers
所
浏览 0
提问于2020-03-04
得票数 0
2
回答
使用
combineReducers
()给出的运行结果与单个还原器不同
、
、
、
我正在尝试从初始
状态
的根还原器初始化一个基本存储。import Entity from "..groupingType、groupingOptions等的正确
状态
初始化反应组件。但是,如果我尝试
使用
combineReducers
()方法--即使只
使用
这个单一根还原器(应该是相同的),那么当我的组件加载
时
,它们没有传递任何初始
状态
。redux存储导入
状态
。的
使用
不像我
使用
单个rootreduc
浏览 1
提问于2018-06-01
得票数 1
回答已采纳
2
回答
这个javascript对象如何进行析构?
、
、
、
我正在试着理解这个React示例:const initialState = { tasks: []在App.js,我们有
浏览 2
提问于2020-02-18
得票数 0
2
回答
使用
combineReducers
时
出错:还原程序"assetsReducer“在初始化过程中返回
未定义
的内容。
、
、
、
错误:还原程序"assetsReducer“在初始化过程中返回
未定义
的内容。如果传递给还原器的
状态
未定义
,则必须显式返回初始
状态
。初始
状态
可能不是
未定义
的。如果不想为这个还原器设置一个值,可以
使用
null而不是
未定义
的。 impor
浏览 2
提问于2019-02-19
得票数 2
回答已采纳
2
回答
React/Redux访问道具
、
、
对于如何在React组件中访问Redux
状态
中的字段,我有疑问:import { fromJS } from 'immutable'; return state; return state;}; homeReducer export default rootRe
浏览 0
提问于2018-02-22
得票数 3
回答已采纳
1
回答
如何在redux中
使用
shapeAssertionError
时
修复combineReducer?
、
、
在redux中
使用
combineReducer方法(redux@3.7.2)
时
,我得到了一个错误。当我只
使用
一个减速器
时
,相同的代码会工作。码 }} const configureStore = (initialState) =
浏览 2
提问于2018-03-09
得票数 0
回答已采纳
3
回答
为什么我的还原器返回
未定义
,反应TypeScript
、
、
这是我的store.tsimportinterface IAppState { general: IGeneralState; authenticated
浏览 5
提问于2019-12-15
得票数 3
回答已采纳
2
回答
理解Redux减速器的存储
状态
、
、
、
、
在试图理解中的react/redux代码
时
,我对mapStateToProps返回的
状态
state.auth.authenticated感到困惑。例如,在用户
使用
窗体登录
时
, this.props.signinUser({email, password});提交表单将导致signinUser函数
使用
type: AUTH_U
浏览 0
提问于2018-04-17
得票数 1
1
回答
使用
combineReducers
未定义
Redux预加载
状态
、
、
我
使用
的是Redux,我有以下代码: foo: "foo", rootReducer,const rootReducer =
combineReducers
({, console.log(state);}); 有了
combineReducers
(),行为就更加微妙了。在preloadedState中指定<
浏览 6
提问于2022-04-27
得票数 0
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
腾讯会议
云直播
对象存储
活动推荐
运营活动
广告
关闭
领券