Redux Toolkit – Why is useSelector returning undefined when attempting to retrieve a post by ID?
I’m building a small blog app to help with learning Redux Toolkit. I’m having an issue where a selector defined in the postsSlice and imported into the SinglePostView is returning an undefined value when attempting to retrieve a post by ID using useParams(). The other selectors work in the same component, but I’m struggling to figure out why this one selector will only return an undefined value. Any ideas on what’s going wrong here or how to fix it? Thanks in advance for any constructive input!
Redux Question: When Component re-renders, does it cause all selectors to run again
I have read in Redux docs:
TS2345: Argument of type ‘AsyncThunkAction’ is not assignable to parameter of type ‘AnyAction’
In my slice, I have defined the action to be as follows:
https://github.com/jasonabanico/RedGranite/blob/main/src/Client/RedGranite.Client.Web/src/app/containers/ItemPage/itemPageSlice.ts
State are not updating inside reducer? redux/toolkit
i am using redux toolkit for my project i have a problem i access the state inside a reducer using current function provided by reduxjs
but when i update the state it is not updating i don’t know why i did a lot of research on that but i didn’t find anything useful here is my reducer
How to nest entities slices inside a parent slice
I’m migrating our old Redux setup to use Redux Toolkit. We have a concept of entities
, which contains nested entities (sites, controllers, users, doors, areas, areaGroups…). This was all controlled by one fat entity reducer and an entity utility function which kind of does a similar thing to createEntityAdapter
, indexing entities by an ID. What I’m trying to do is create nested slices.