我正在尝试将我正在构建的应用程序切换到使用Redux Toolkit,并注意到在从createStore切换到configureStore后立即出现此错误:A non-serializable value was detected in the state, in the path: `var...
我需要将当前状态重置为初始状态,但是我的所有尝试都失败了。我该如何使用Redux Toolkit实现它?const showOnReviewSlice = createSlice({ name: 'showOnReview', initialState: { returned:...
我已经学习了2个月的redux toolkit,我知道在createSlice中有reducers和extrareducers,它们都用于从dispatch中改变状态,但我不知道它们之间的区别,我们应该在哪里使用它们?
我遇到了Redux Toolkit(RTK),希望能够进一步实现它提供的功能。 我的应用程序通过使用 createSlice({}) 创建的 reducers 片段分发操作(请参见createSlice api docs)。 到目前为止,这个方法运作得非常好。 我可以轻松使用内置的 dispa...
所以,Redux中的createStore()已经被弃用了,建议使用@reduxjs/toolkit中的configureStore()。 我很确定这与我无法在我的action中使用getState()来获取userInfo状态有关。 userLogin的getState()返回undefin...
在一个reducer action中使用console.log()时,状态会以Proxy对象的形式打印出来,而不是我想要查看的对象。我该如何查看实际的对象?我正在使用redux-starter-kit createSlice,我不确定这是否与此有关。import { createSlice }...
我的问题是我应该使用哪个?Redux Toolkit可以替代Redux核心吗?
store.tsexport const store = configureStore({ reducer: { auth: authReducer }, middleware: [], }); export type AppDispatch = ty...
我有我的减速器 const userAuthSlice = createSlice({ name: "userAuth", initialState: { token: '', }, reducers: { setToken: (...
在我的Redux存储库中,我有多个切片,并且我想在speciesSlice中访问settingsSlice的lang状态。 以下是我的切片代码示例:const settingsSlice = createSlice({ name: 'settings', initialState: {...