Category "redux"

Why is this variable from the Redux store not in the `this.props` on React page?

I have a variable that I believe is correctly written to my Redux store using a Redux action and reducer. But for some reason it never becomes part of the props

How to only change selected state value from useDispatch function in redux

I am using google OAuth for authentication in the nextJS project with next-auth and on login, I store the name, email in the store. but in the initial state, I

Redux toolkit useselector doesn't grab the state properly

I'm trying to store my current user using redux toolkit. I'm dispatching the action in the Login page and it looks like when I try to grab the user state on tha

Easy-Peasy StoreProvider returns the error "Property 'children' does not exist on type..."

I got this error on <StoreProvider ...> Why? What can be wrong with the children? :( TS2769: No overload matches this call. Overload 1 of 2, '(props: {

Redux Toolkit: How can I store a serialized action creator in state?

Question I am using Redux Toolkit and I want to store an action creator in state. When I do this, I receive an error regarding non-serializable values in my act

Trying to refactor React App to React-Redux issue w/ volume slider

I've been doing freecodecamps Drum Machine app. I was able to complete the app completely with React but I made a copy to try and get familiar with using react-

How to define common query params in Redux Toolkit Query

All the endpoints of the API I'm working on, require the same set of query parameters. The user must select these parameters before making requests to endpoints

TypeError: undefined is not an object (evaluating 'state.favoriteBooks.findIndex')

Every time I press the favorites button it gives me an error. TypeError: undefined is not an object (evaluating 'state.favoriteBooks.findIndex') This error oc

Redux createStore() is deprecated - Cannot get state from getState() in Redux action

So, the createStore() Redux is now deprecated and configureStore() is recommended from @reduxjs/toolkit. I'm pretty sure it's related to not being able to get u

Using redux toolkit in NextJS without next-redux-wrapper

I'm new to NextJS and I'm trying to figure out on how to implement RTK, I stumbled on this github repo example from Jack Harrington and basically his slices has

File Upload with axios using redux

Currently, I'm able to test a file upload function. and that looks like this const handleFileUploadSubmit = (event) => { event.preventDefault() const

Flex direction changes when I use persist gate(next js with redux)

I am using next js and redux to build an app. When I use in my _app.js the flex direction changes in index.js, from row to column. No changes in the CSS or in

Creating a createSelector in Redux that does not rerender unrelated components

I have a simple document maker that allows users the create multiple fields of two types (input field and label field). They can also rearrange the field via dr

Jest tests breaks when calling getState outside a component in React

A bunch of my tests suddenly started breaking when I use store.getState() inside a function in React. If I log the store, the store exists but it is still break

spread operator vs immutable.js

It seems like when using redux with react, immutable.js has become almost a industry standard. My question is, aren't we making changes to our redux states immu

Redux toolkit filter() not working when wanting to display new array at the same time

I am currently building a clothing shop in which you can add products to the cart, and delete each one of them as you like and it makes the cart re-render and d

Wait for previous dispatch action to complete

const onFeedSubmit = async (data: PostFeedActionProps) => { try { setPostingFeed(true); selectedBusinessList.forEach(business => {

Redux store data being reset upon "getServerSideProps" being called; not persisting

Overview: I have a TypeScript NextJS project that I am using Redux-toolkit with to manage state. My file structure for my Redux store and pages are as follows:

How do I unsubscribe to the dispatch to grab new data onload on useEffect? - I'm using Redux Toolkit

I can load my data but only after I refresh the page. Until then, it shows the data from the previous item I clicked on. It's behaving like a cache would. Here

making post request with createAsyncThunk redux toolkit

Following is my reduxtoolkit code. I am trying to post data but it is giving me 422 error. The response says spot_id and item_id required but I am sending it. A