DEV Community

Muhammad Hamza Hijazi
Muhammad Hamza Hijazi

Posted on

Is it Necessary to use Redux with a Next.js application ?

is using redux with next.js based app is considered anti-pattern or we are supposed to use redux even with next.js application like all other react applications.

Top comments (7)

cadams profile image
Chad Adams

I use with my next.js project. I would recommened redux but use a library like this to reduce the boilerplate. One thing thats nice about using Redux is you can take advantage of Redux dev tools which can be very useful.

klis87 profile image
Konrad Lisiczyński • Edited

This question could be rephrased as: "Is it Necessary to use Redux with a React.js application" :)

Next.js is just a framework on top of React which simplifies Server Side Rendering setup, but it is still React. And React/Redux combo is very popular and still often used, also by me, so the answer is - it is not necessary, but totally possible! The bigger the app and the more you like functional programming, the better chance Redux will be a good option!

ivoberger profile image

There's an official example with redux in the nextjs repo:
So I'd say, not an anti pattern.

mnlfischer profile image

there is no need for it. You can use the context api instead.

karanpratapsingh profile image
Karan Pratap Singh

Not an anti pattern, you can use it if you want but it’s not necessary, personally I would recommend zustand

muhsarip profile image

its nightmare on persisting data, not recomended

revskill10 profile image
Truong Hoang Dung

It depends on types of app you build. Do you need global state ? If yes, then Redux is useful, else Redux is unnessessary.