Questions tagged [next-redux-wrapper]

85 questions
1
vote
1 answer

pageProps vs props in nextjs

I looked at what nextjs returns when navigating the page and noticed that the state of hydration is duplicated on the page and transmitted in two different properties of the object: I do not understand whether this is the norm of logic or whether…
UKRman
  • 404
  • 3
  • 16
1
vote
0 answers

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: (/store is at the root of my project) Project layout: I have 2 pages (index.tsx and…
Matthew Trent
  • 2,611
  • 1
  • 17
  • 30
1
vote
0 answers

How to use different types of store for each page with next-redux-wrapper

next-redux-wrapper forces me to structure different pages using a single type of store. But different pages mostly have a lot different states, which can lead debugging a page through devtools messed up with too many unused properties. How to use…
Changdae Park
  • 911
  • 1
  • 9
  • 22
1
vote
1 answer

How to use getStaticPaths with Redux in Next.js?

How do I use getStaticPaths when using Redux with Next.js? I am using next-redux-wrapper to store my content and i am having trouble getting the data to display. Please see my code example below import { useSelector } from "react-redux"; import…
Tjs90
  • 61
  • 1
  • 10
1
vote
1 answer

How can I use next-redux-wrapper with redux-toolkit without typescript

I'm In trouble With Making a new nextjs app using redux-toolkit with next-redux-wrapper and all methods I found is explain using typescript So Please Help Me if you can I want to Make an Application Use Using Nextjs , Redux-toolkit and…
1
vote
1 answer

next-redux-wrapper in getServerSideProps in nextjs

I am trying to call one action function in getServerSideProps. I am using typeScript. Actually, in javascript I use it only this way- import { wrapper } from "Redux/store"; import { getVideo } from "Redux/Actions/videoAction"; //Serversider data…
user18136092
1
vote
1 answer

storage is not being update using redux-persist with next-redux-wrapper (Typescript)

I am trying to add redux-persist with next.js using next-redux-wrapper, but storage is not updating , state is lost during page refresh, Here is my store.ts file :- import { createStore, applyMiddleware } from 'redux'; import { createWrapper } from…
1
vote
1 answer

How to dispatch an action from inside getInitialProps?

I am trying to implement Redux in a Next.js app and have problems getting the dispatch function to work in getInitialProps. The store is returned as undefined for some reason that I cannot figure out. I am using next-redux-wrapper. I have followed…
Harry_C
  • 179
  • 1
  • 1
  • 14
1
vote
1 answer

next-redux-wrapper server not sync with client?

Currently to do Next js and Redux connect with next-redux-wrapper. The problem is the code does not work as I think.. I'm trying to make basic counter What I expected During getServerSideProps, dispatch add(3) that add 3 to initialState 0, so after…
홍우지
  • 335
  • 1
  • 9
1
vote
0 answers

Reason: `object` ("[object Object]") cannot be serialized as JSON. Please only return JSON serializable data types

I am using next.js immutable Js and redux saga. Error: Error serializing .initialState.ui returned from getServerSideProps in "/me/profile-setting". Reason: object ("[object Object]") cannot be serialized as JSON. Please only return JSON…
1
vote
2 answers

ERROR: Using UNSAFE_componentWillReceiveProps (NextJs / Redux)

Today I started to build a Next.js application. I am using Redux (next-redux-wrapper) to manage my global state. (I am also persisting some reducer with redux-persist). I just implemented redux-thunk and immediately got a very strange error. I…
drag98
  • 37
  • 1
  • 6
1
vote
0 answers

Accessing MongoDB during server side rendering page in redux-wrapped Nextjs

I was exploring the nextjs example with-redux-wrapper where they show how to create a nextjs react app with redux-wrapper and server side rendering. I want to load some data from a MongoDB collection at request time. This can be easily done using…
sbsatter
  • 591
  • 3
  • 22
1
vote
2 answers

Nextjs - await store.dispatch Cannot read property 'dispatch' of undefined

I'm new to React, Redux and have been following tutorials on the topic. I'm come across a lot of issues that I've been able to resolve but I've come across an issue I can't resolve. I set up store, and can even view it through Chrome's Redux Tools…
JCP
  • 119
  • 10
1
vote
1 answer

Using getStaticProps with next-redux-wrapper

I'm developing a simple next.js app. For state management I'm using next-redux-wrapper. In my home page I want to fetch all the rooms in my database from my api using store.dispatch. When I use getServerSideProps and dispatch an action it works, it…
Bob Stone
  • 97
  • 1
  • 9
1
vote
2 answers

Updated object not being returned properly in nextjs

So basically I'm working on a nextjs app which uses authentication. I have a 2 functions which I run on every page load. The first checks if jwt cookies exist and calls another function to validate the tokens if they don't exist. This function is…
darkstar
  • 829
  • 11
  • 23