Questions tagged [next-redux-wrapper]

85 questions
3
votes
1 answer

I have successfully implemented the redux-persist with next-redux-wrapper in next js

Im getting data from the external api and storing it in the reducer.And im using redux-persist to persist the state while navigating from one page to another.But i have made left the whiteList as an empty array but all the state are being…
Paras Buda
  • 51
  • 1
  • 6
2
votes
0 answers

RTK Query in SSG - Extracting Rehydration Info not working as expected

According to the steps mentioned in the RTK Query documentation for SSR: I first configured next-redux-wrapper. Then, I called two lines of code in the SSG call. The third step was to add extractRehydrationInfo, which I also added. The…
2
votes
0 answers

Store State Issues - Next Redux Wrapper vs Redux ToolKit

FYI: Everything is working fine and all the flows are working as expected but logs are confusing. I am using Redux ToolKit for managing redux state & using Next Redux Wrapper for Server Side rendering and caching queries. CartSlice.js import {…
2
votes
0 answers

next-redux-wrapper initialStateFromGSPorGSSR Redux implementation in nextjs

There's no data in initialState but there's data in initialStateFromGSPorGSSR, I think there might be an error about reducers and I couldn't solve it. This is the log that returned from browser console; *4. withRedux(MyApp) created new store with…
eErgun
  • 27
  • 3
2
votes
0 answers

After building nextjs app, chunk/pages/_app-.....js file size is too large

I have a next js project that is created by create next app and modified _app.ts to this import "../../public/assets/css/bootstrap.css"; import "antd/dist/antd.css"; import "../../public/assets/css/common.css"; import "../styles/globals.css"; import…
Najmus Sakib
  • 447
  • 5
  • 14
2
votes
0 answers

nextjs get slow on route change in react 18 and redux(legacy and toolkit)

the issue is: when we use react 18.0.0 to 18.2.0 the app takes around 7 sec on production to change the route. on development mode everything is fine. I am facing this issue since the release of react18, We were using old school redux and face this…
2
votes
0 answers

Is it anti-pattern to handle getServerSideProps api requests with redux-thunk then access it's data in page with useSelector?

In next.js We can request to api in getServerSideProps and pass data to page through props like this : method 1: (next default approach) const Page: NextPage = ({page}) => { return
{JSON.stringify(data)}
; }; // This gets called on…
2
votes
2 answers

Is it really required to use 'next-redux-wrapper' in a 'Next.js + Redux Toolkit' application when doing only 'static generation'?

I'm planning to create a Next.js application along with Redux Toolkit for state management. I'll only be doing Static Generation (using getStaticProps & getStaticPaths). Do I need to use next-redux-wrapper…
2
votes
0 answers

What are the use cases of next redux wrapper?

I'm trying to use the next js example with redux config . I came across two examples one with simple with-redux config setup and the other with with-redux-wrapper . I read all the readme stuff and still didn't quite get it . What are the use cases…
user12653085
2
votes
2 answers

getInitialProps doesn't seem to work when using Next.js with next-redux-wrapper

I'm trying to hook my next.js web app with redux by using 'next-redux-wrapper' HOC. I was able to fetch data from server from getInitialProps function but after wrapping my _app.js with next-redux-wrapper the getInitialProps functions doesn't seem…
Justin M
  • 177
  • 1
  • 3
  • 11
2
votes
1 answer

How to config appWithTranslation(nexti18next + withRedux (next-redux-wrapper) in __app.js

I'm tranfer reactjs project to nextjs with react-redux, redux, nexti18next, next-redux-wrapper here is _app.js and redux.js it run right but if i add withRedux it is error. Please tell me how to resolve this problem or advide me some…
1
vote
0 answers

getServerSideProps not initialising client side state (next-redux-wrapper, redux/toolkit, redux-saga) Next.JS

I am doing a NextJS project using next-redux-wrapper, redux/toolkit and redux-saga. This is my setup: store/enquiry/slice.ts: import { PayloadAction, createSlice } from '@reduxjs/toolkit' import { HYDRATE } from 'next-redux-wrapper'; export enum…
1
vote
0 answers

How to prevent duplicate initialState from client response in next-redux-wrapper?

I am using next redux wrapper in App.getInitialProps but in client response I get duplicated initialState are: initialState outside pageProps and inside pageProps, this happens everytime when navigate to another page. How can I fix it? You can see…
Epple
  • 640
  • 14
1
vote
0 answers

Why is my server storage not syncing with the client one in Next.js app?

Problem: My next.js app crash on client side because of empty store object, but if I try to read this object in getServerSideProps it`s ok. I have 2 pages in my app, profile/[id] and post/[id], all of them have getServerSideProps User flow: User…
1
vote
0 answers

How do I get param(or query) in wrapper.getServerSideProps(next-redux-wrapper)?

I used getServerSideProps on the wrapper. And I printed out the param(query) and it was undefined. How do I get params(query)? const Home = () => { const router = useRouter(); const { id } = router.query; return
{id}
; }; export…
Yoo Guk
  • 21
  • 1