DEV Community

Server-Side Rendered App with Next.js, React and Redux

Waqasabi on January 12, 2020

There are many known benefits to pre-rendering your web application or rendering your web app on the server-side, some of which include better SEO,...
Collapse
 
markerikson profile image
Mark Erikson

Please check out our new official Redux Toolkit package. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once:

redux-toolkit.js.org

Collapse
 
aidosmen profile image
aidosmen

Can you plesae show the example how to dispatch actions in getStaticProps and how to get data from Redux into the getStaticPaths , in case if you use dynamic route [id].jsx

Collapse
 
daniilgri profile image
Danil Grishaev

/!\ You are using legacy implementaion. Please update your code: use createWrapper() and wrapper.withRedux().

Collapse
 
metin1 profile image
metin1

I had the same problem. I find a solution like this: "If you use Thunks middleware you don't need to use next-redux-wrapper." I removed it and my problem was solved.

Collapse
 
pushpit07 profile image
Pushpit

How does that work @metin1? Can you please explain or give an example? I'm facing the same issue

Collapse
 
rxmvinv profile image
rxmvinv

Thanks. But don't forget to keep versions of packages from repository. In latest versions store isn't taken from "this.props" in MyApp component in _app.jsx

Collapse
 
tmangosteen65 profile image
tmj65

Can't wait for part 2

Collapse
 
tsuki1819 profile image
Yare la lesbiana 🤠

Excellent content !. Waiting for the next part <3

Collapse
 
mahdidavoodi7 profile image
Mahdi Davoodi

Could you please tell me how to connect this app to the express server ??

Collapse
 
lukfcsl profile image
Lucas Farias

There is no express server with next.js

Collapse
 
5ervant profile image
Mark Anthony B. Dungo • Edited

Is it really good to use Redux on a Next.js app or the other middleware, or not?

Collapse
 
infamousgodhand profile image
Huang

Great write up, has got me started in the right direction. Thank you

Collapse
 
rbueno profile image
Rafael Bueno

Hi amazing content. Pleasae the second party regarding localstorage with next js