Questions tagged [next-redux-wrapper]

85 questions
19
votes
6 answers

Access Redux store outside React when using next-redux-wrapper

I have a NextJS React app that uses the next-react-wrapper (basically a HOC) on _app.tsx like so: _app.tsx ... import withRedux from 'next-redux-wrapper'; class Page extends App { ... } export default…
CaribouCode
  • 13,998
  • 28
  • 102
  • 174
14
votes
3 answers

Using react redux with next.js

I try to use Redux with next.js starter project and I installed next-redux-wrapper on the project but I'm not sure where is the root file in this project. I try to follow the tutorial shown on the next-redux-wrapper but had no success. Nothing…
Giffary
  • 3,060
  • 12
  • 50
  • 71
5
votes
2 answers

What's hydrate action in Next Redux Wrapper?

Recently I started using Next.js and I have a question about the next-redux-wrapper package. I don't really understand the HYDRATE action. So I wonder concretely what it is, what is it for and when is it launched. Because currently the only thing I…
Theo
  • 171
  • 1
  • 4
  • 5
5
votes
1 answer

Next.js with next-redux-wrapper state is being reset to initial value when navigating using Link

Next.js v12.0 next-redux-wrapper. Whenever I navigate away from the page using the appropriate next/link element and then back again (using another link el) the state is reset to the initial value and so another fetch is executed. What is strange…
James Gagne
  • 91
  • 1
  • 5
5
votes
1 answer

next-redux-wrapper TypeError: nextCallback is not a function error in wrapper.getServerSideProps

I'm getting TypeError: nextCallback is not a function error when I try to export wrapper.getServerSideProps function. My Code import App from '../components/App' import {wrapper} from '../redux/Store'; import {getRooms} from…
zia sultan
  • 340
  • 3
  • 17
5
votes
1 answer

Next redux wrapper arise error of Cannot read property 'getState' of undefined

In this project, I use the next js library along with redux and I also use next redux wrapper I do everything as mentioned in the next redux wrapper document but it is not working properly here it arises the getState of undefined error as I display…
Tech Sourav
  • 124
  • 1
  • 7
5
votes
1 answer

Next-Redux-Wrapper not updating SSR Store

I'm working on an app that uses SSR. It is based on React, Next, and Redux. I understand the general concept of having a client side store and a server side store and having them be synced to each other. I am using next-redux-wrapper but can't seem…
4
votes
1 answer

next-redux-wrapper HYDRATE getting called multiple times

I am starting a new next js project,we are migrating from a normal react app to a next app. we intend to use redux toolkit for our global state management and we are using server side rendering.so we came across next-redux-wrapper npm package which…
4
votes
1 answer

empty state in next-redux-wrapper

i've been having troble getting my nextjs app to work with getServerSideProps() for server-side-rednering. i tried implemening next-redux-wrapper but the state is empty. *note: redux works fine while it was running on client side, but now im trying…
4
votes
1 answer

Preserve state value on client side navigation - NextJs - Next-Redux-Wrapper

So I am trying to fix the hydrating issue I am facing when using wrapper.getServerSideProps. When I reroute with the current setup the store is cleared out and then the new data is added, which results in a white page since a lot of important data…
Wesley Janse
  • 1,244
  • 1
  • 7
  • 14
4
votes
1 answer

How to combine multiple getServerSideProps wrappers?

I'm using two libraries in my NextJs app: next-firebase-auth and next-redux-wrapper. Both of them require me to wrap getServerSideProps with their respective functions. For next-firebase-auth export const getServerSideProps = withAuthUserSSR()(async…
4
votes
2 answers

how to use typescript, next-redux-wrapper, getServerSideProps?

I want JavaScript -> TypeScript! but, so hard. // store.js import { applyMiddleware, createStore, compose, Store } from "redux"; import createSagaMiddleware, { Task } from "redux-saga"; import { createWrapper } from "next-redux-wrapper"; import {…
Boo Choi
  • 59
  • 1
  • 5
3
votes
2 answers

Next.js using next-redux-toolkit - How to initially call an action before loading a certain page?

My folder structure looks like this: / pages / [project_id] / index.jsx <- make this (or another external component) call an action before other pages will load / assets.jsx / information.jsx / ... Before I'm…
Artemixx
  • 97
  • 5
3
votes
0 answers

useWrappedStore missing in next-redux-wrapper

I was trying to implement the next-redux-wrapper with redux-toolkit. As the example suggests in https://github.com/kirill-konshin/next-redux-wrapper/blob/master/packages/demo-redux-toolkit/pages/_app.tsx. As the example suggests, the store should be…
Ramees Salim
  • 31
  • 1
  • 3
3
votes
0 answers

redux next wrapper - hydrate method is loosing the previous state on page change

I am new to next-redux-wrapper and trying to use it to persist the state across pages. On the home page, I have login action. When login succeeds, I am adding a session.loggedIn : true to redux store. When I transition to the next page…
Mopparthy Ravindranath
  • 3,014
  • 6
  • 41
  • 78
1
2 3 4 5 6