How to add Redux to ANY Next.js app in 15 minutes (For Beginners)

  Рет қаралды 71,307

Sonny Sangha

Sonny Sangha

Күн бұрын

🚨 Join the world’s BEST developer community “Zero to Full Stack Hero”: www.papareact.com/course
📩 Want coding problems (with solutions!) delivered to your inbox daily? www.papareact.com/dailycoding...
🔴 LOOKING FOR THE CODE? 🛠️
links.papareact.com/github
👇🏻FOLLOW ME HERE:
Instagram: links.papareact.com/instagram
Facebook: links.papareact.com/facebook
LinkedIn: links.papareact.com/linkedin
Twitter: links.papareact.com/twitter
Discord: links.papareact.com/discord
Newsletter: links.papareact.com/newsletter
💰 WANT TO SUPPORT THE CHANNEL?
Donate here: links.papareact.com/donate
Grab some PAPA Merch: links.papareact.com/merch
🕐 TIMESTAMPS:
00:00 Introduction
00:19 SkillShare Sponsorship
02:05 Initialising the Next.js App with Typescript
02:54 Adding Redux & Setting up the Store
04:13 Wrapping App in a Redux Provider
05:38 Creating our First Redux Slice
08:48 Importing Counter Slice to the Store
09:29 Starting the App & Debugging with Redux Devtools
10:24 Adding our first Selector with the useSelector Hook
11:50 Adding Buttons to Dispatch Actions with the useDispatch Hook
12:36 Testing our App built with Redux!
13:32 Bonus Tip: How to correctly write a Selector
14:38 Outro
Let’s get it PAPAFAM 🔥.
#reactjs #nextjs #redux

Пікірлер: 111
@SonnySangha
@SonnySangha Жыл бұрын
📬Do you want DAILY coding problems sent DIRECTLY to your Inbox? (with solutions the next day) 👉 links.papareact.com/university
@stevenwoolston8620
@stevenwoolston8620 Жыл бұрын
Excellent description of Redux. I’ve been confused by all of the ‘jargon’ that surrounds Redux but you explained it in simple terms. Well done
@jonjojr
@jonjojr Жыл бұрын
I prefer the long form clone series, but little focus videos like this are very useful to supplement the long form. Great video man, thanks.
@swayze_0
@swayze_0 Жыл бұрын
Briefly, clearly, qualitatively. Keep it up!
@cyberstair
@cyberstair Жыл бұрын
he makes this so easy !! keep going man
@generallifing
@generallifing Жыл бұрын
Amazing!! Clean and Clear!!! I was a redux hater. Since the redux toolkit release, I will use redux as my state management tool again, thx Sonny!
@chriscrowd4946
@chriscrowd4946 Жыл бұрын
Short and sweet! Thanks!
@govindbchandran8681
@govindbchandran8681 Жыл бұрын
Nice one sonny, much needed
@apacolypse2
@apacolypse2 Жыл бұрын
I been doing it this way for awhile, it's easier than the old way I was doing it.
@Brenosalv
@Brenosalv 10 ай бұрын
I just can't believe the quality of your content. Amazing!
@SonnySangha
@SonnySangha 10 ай бұрын
Glad you enjoy it! Thanks dude!!
@tarisadindadeliyanti8401
@tarisadindadeliyanti8401 Жыл бұрын
omg, I'm grateful to be able to meet this channel soon. U explained so well. Thanks ^^
@SonnySangha
@SonnySangha Жыл бұрын
You're welcome 😊
@ahmadshbeeb
@ahmadshbeeb Жыл бұрын
thanks bro, this is exactly what i was looking for.
@Divyam2600
@Divyam2600 Жыл бұрын
Please Sir bring your 5 day event soon!! Truly missing them very much.. Those were golden times.. Although I could never submit the code as I couldn't follow up but now I have evolved and will surely prove to be among the ones who get featured 💥💥 #PapaFam #PapaReact #SonnySangha
@PattyBeautCode
@PattyBeautCode Жыл бұрын
Awesome ! quick lesson but very straight to the point !! Now I get to know Mr. Redux even better. Thanks Sonny !
@zacpour4997
@zacpour4997 Жыл бұрын
Redux store gets wiped out with NextJS SSR from one page to another. You can't simply use React Redux in a one page app and assume it'll work for most NextJS projects. You can't simply use your react tools with NextJS!✋
@DoGzTheFiGhTeR
@DoGzTheFiGhTeR Жыл бұрын
Great work bro, Thanks 👍
@aniketbhalla1521
@aniketbhalla1521 Жыл бұрын
Awesome .....I was just about to do that in my project. I hope we don't need next-redux-wrapper.
@carlopelosi5251
@carlopelosi5251 Жыл бұрын
Hey Sonny! Can you help us understand, how does nextJS plays with Redux when using server side props and static side props, Example, if we have a redux action that hits an API should we do this in server side props? Or is this something we don't have to worry about
@kiragaming4499
@kiragaming4499 5 ай бұрын
very useful thanks a lot
@krutomjer
@krutomjer Жыл бұрын
Nice, quick way to learn stuff
@programmingwithnit5308
@programmingwithnit5308 Жыл бұрын
Thank you so much.
@ghofranedarragi5601
@ghofranedarragi5601 Жыл бұрын
thanks for this explanation
@el-vijay8903
@el-vijay8903 Жыл бұрын
Best tutorial ever.
@mahdiabolghasemi189
@mahdiabolghasemi189 Жыл бұрын
thank u for best teaching
@MrAps98
@MrAps98 Жыл бұрын
Love you, Mr. Sangha.
@wilsonibekason
@wilsonibekason Жыл бұрын
Thank you @sonny sangha, your content is very useful
@h_maina
@h_maina Жыл бұрын
hi Sonny, which screen recording software do you use?
@talsadan8485
@talsadan8485 Жыл бұрын
Sonny you the best!
@elkhanhamet2561
@elkhanhamet2561 Жыл бұрын
Thank you!!!
@Euquila
@Euquila Жыл бұрын
So we are 1) server-side rendering our apps, 2) serving them to the clients, 3) the clients run some JS and setup a state manager that runs on the client, 4) User navigates to another route, which causes our store to be reset no? I'm having a really hard time understanding this architecture
@sourenasahraian2055
@sourenasahraian2055 Жыл бұрын
Could you plz at least once post a video on how a NEXT app can be deployed to AWS ? How do the SSG and SSR work there does it mean SSR is gonna work in A lamda ?
@xxXAsuraXxx
@xxXAsuraXxx Жыл бұрын
Nice. Could you show us redux in SSR with next js ?
@federicoaguilera9573
@federicoaguilera9573 Жыл бұрын
Plis
@amirbasiri6555
@amirbasiri6555 Жыл бұрын
you're awesome, could you have a video with redux and server side rendering in next js. It is a bit confusing.
@amirbasiri6555
@amirbasiri6555 Жыл бұрын
@♜whatsapp±1580𝟾𝟻𝟹𝟹𝟹56 Sonny thank you so much 🌹🌹🌹👍👍
@jaular14
@jaular14 Жыл бұрын
Thanks for the video. Could you make a video about Zustand or tRPC? Please 🙏
@mdsayem8893
@mdsayem8893 Жыл бұрын
You are the best❤️
@chiragramachandra
@chiragramachandra Жыл бұрын
I remember how I struggled to do it the first time despite having NextJS official documentation! Phew
@cyberstair
@cyberstair Жыл бұрын
so much love to you
@x-city5801
@x-city5801 Жыл бұрын
Amazing video
@gajen4evr
@gajen4evr Жыл бұрын
Great..! 👏👏👏
@ulugbekasadov5751
@ulugbekasadov5751 Жыл бұрын
Hey Sonny can you do video about how to use redux without redux/toolkit, Thanks
@constantinemihailov4218
@constantinemihailov4218 Жыл бұрын
❤ thank you.
@jayantjagtap2976
@jayantjagtap2976 Жыл бұрын
How to we use connect method to the components. Because using use selector for multiple values can be tedious. Help me out.
@UpdaterMC
@UpdaterMC 9 ай бұрын
can you update this tutorial with the latest next js version please
@Angelmc_pixelduck
@Angelmc_pixelduck Жыл бұрын
ty
@mihailodrinic4003
@mihailodrinic4003 Жыл бұрын
Very good video
@kulvirsingh4568
@kulvirsingh4568 Жыл бұрын
Waheguru ji ka khalsa waheguru ji ki Fateh Awesome Sonny 🔥🔥
@brayandvelasquez2256
@brayandvelasquez2256 Жыл бұрын
It would be great if you make a video explaining how to use redux and getServerSideProps!!
@georgeraytchinov7794
@georgeraytchinov7794 Жыл бұрын
Sunny, can you add microsoft authentication to your next app build, would really appreciate it. Thanks!
@fahimhassan4387
@fahimhassan4387 Жыл бұрын
Please make a video on redux rtk query with next js
@jonasmeteling
@jonasmeteling Жыл бұрын
Dont you need the nextjs-wrapper to make it work in a nextjs app?
@martapfahl940
@martapfahl940 Жыл бұрын
CMND + J, thanks buddy :D
@merajansari0773
@merajansari0773 Жыл бұрын
please make more videos sir
@x-city5801
@x-city5801 Жыл бұрын
What’s the difference between redux and redux toolkit
@carefree_ladka
@carefree_ladka Жыл бұрын
It'd be good if you showed us how to use SSR with nextjs and Redux Toolkit
@saikrishnamuntha62
@saikrishnamuntha62 Жыл бұрын
bro have you find any tutorial on this SSR with RTK.I f u know please share
@jeheskielsunloy3881
@jeheskielsunloy3881 Жыл бұрын
@@saikrishnamuntha62 you can use next-redux-wrapper for SSR with redux
@saikrishnamuntha62
@saikrishnamuntha62 Жыл бұрын
@@jeheskielsunloy3881 with out using next-redux wrapper can we use????? and we r dispatch in handlesubmit and also to keep dispatch in getserversideprops() is this way correct????????????? or any idea from ur side any link or video can u share?
@vinodhm8452
@vinodhm8452 10 ай бұрын
​@@jeheskielsunloy3881 how to wrap the layout.jsx when using reducer wrapper I tried but not working can u share the code I'm using Next 13
@eguoli
@eguoli Жыл бұрын
不错大哥。
@dilkashshaikhmahajan1185
@dilkashshaikhmahajan1185 Жыл бұрын
Hi Brother please make one video on how to make a api call in redux toolkit in Nextjs
@ElbinBinil
@ElbinBinil Жыл бұрын
Make a redux crash course
@usamasaud9226
@usamasaud9226 Жыл бұрын
Can you please make any basic app using React Native using Redux and Typescript ( with npm packages ) PLEASE? Your half hour tutorial would be very helpful.
@SonnySangha
@SonnySangha Жыл бұрын
Great suggestion!
@NeerajSingh-ch7wl
@NeerajSingh-ch7wl Жыл бұрын
@@SonnySangha Sir, if possible please use client side field level encryption in MongoDB to secure the database just like to provide Pay slip of employee and also secure the bank details data using client side field level encryption. I don't found any video on youtube or anywhere using client side field level encryption in MongoDB
@NeerajSingh-ch7wl
@NeerajSingh-ch7wl Жыл бұрын
@@user-sq7de3dd2j Sir, if possible please use client side field level encryption in MongoDB to secure the database just like to provide Pay slip of employee and also secure the bank details data using client side field level encryption. I don't found any video on youtube or anywhere using client side field level encryption in MongoDB
@trixwebtech307
@trixwebtech307 Жыл бұрын
NICE
@dannyisrael
@dannyisrael Жыл бұрын
Does anyone know what he's using for the code autocomplete? Is it Co-Pilot?
@stephonking2847
@stephonking2847 Жыл бұрын
I'd love to get your course but does it hae to be so expensive.... sigh
@dream__moments
@dream__moments Жыл бұрын
when page is serverSide rendered can we use this to update redux store ??
@abbaskareem5281
@abbaskareem5281 Жыл бұрын
I don't think so, because the store is on the browser .. I hope someone give us correct answer.
@doz7979
@doz7979 Жыл бұрын
No, as long as your next.js app is not a single-page application, all redux states gone once the new page is loaded
@dream__moments
@dream__moments Жыл бұрын
@@doz7979 thats why still we require next redux wrapper
@abdullahelwalid4494
@abdullahelwalid4494 Жыл бұрын
Can you make another video using redux with next 13
@amiramaouch2774
@amiramaouch2774 11 ай бұрын
with nextjs 13 we can't simply wrap the react-redux Provider around the app
@anesunyamasoka8791
@anesunyamasoka8791 Жыл бұрын
was literally stuck on this
@villagelifewithmerinkitche9136
@villagelifewithmerinkitche9136 Жыл бұрын
Good
@djordjen9424
@djordjen9424 Жыл бұрын
How about Recoil?
@ogarjosephodama1878
@ogarjosephodama1878 Жыл бұрын
Hello Sonny, can you do cash app build or clone?
@ogarjosephodama1878
@ogarjosephodama1878 Жыл бұрын
Scammer!
@simple_islam_
@simple_islam_ Жыл бұрын
Can you make a video on passing data from child to parent component please......
@SonnySangha
@SonnySangha Жыл бұрын
You ideally don’t want to do this, hence why you introduce state management tools such as redux or recoil
@simple_islam_
@simple_islam_ Жыл бұрын
@@SonnySangha but few companies are still using props to pass data😬
@saikrishnamuntha62
@saikrishnamuntha62 Жыл бұрын
bro here there is nothing to add next-redux wrapper and do a project on the apis calling in reduxtoolkit and do authentication in nextjs
@ComputationalArt
@ComputationalArt Жыл бұрын
ContextAPI is It better than Redux? Why we have to use Redux? ContextAPI is easy respect redux
@davenpaint
@davenpaint Жыл бұрын
Actually, Redux doesn't work with next.js 13 with Typescript embed in a Server component.
@DoGzTheFiGhTeR
@DoGzTheFiGhTeR Жыл бұрын
Follow the tutorial to the T, its 100% working using latest next version 13.0.4 "dependencies": { "@reduxjs/toolkit": "^1.9.0", "next": "latest", "react": "18.2.0", "react-dom": "18.2.0", "react-redux": "^8.0.5" }, "devDependencies": { "@types/node": "18.11.3", "@types/react": "18.0.21", "@types/react-dom": "18.0.6", "autoprefixer": "^10.4.12", "postcss": "^8.4.18", "tailwindcss": "^3.2.1", "typescript": "4.8.4" }
@davenpaint
@davenpaint Жыл бұрын
@@DoGzTheFiGhTeR Redux run correctly in a page component, not in a server component. A huge issue ticket was opened on github.
@flemingstarsyiemlieh2125
@flemingstarsyiemlieh2125 Жыл бұрын
Does anyone here know how to use redux persist with nextjs... Thanks in advance
@riponindo9823
@riponindo9823 Жыл бұрын
Hi
@jamezfatout
@jamezfatout Жыл бұрын
Does anyone here know how to use redux persist with nextjs...
@grx4.067
@grx4.067 Жыл бұрын
Bro will you consider making a separate hindi channel
@gigakvachakhia4777
@gigakvachakhia4777 Жыл бұрын
how about ssr or data fetching (( ?
@user-fx5ke9ip2z
@user-fx5ke9ip2z Жыл бұрын
M͛o͛r͛e͛ UPDATE o͛n͛ N͛F͛T͛s͛,BTC W͛h͛a͛t͛s͛a͛p͛p✙𝟏𝟑𝟎𝟐𝟑𝟒𝟓𝟏𝟏𝟐𝟔 M͛o͛r͛e͛ UPDATE o͛n͛ XRP ,N͛F͛T͛s͛,BTC 📊 👆👆
@user-fx5ke9ip2z
@user-fx5ke9ip2z Жыл бұрын
🌁📩📩ꜱᴇɴᴅ ᴍᴇ ᴀ ᴅɪʀᴇᴄᴛ ᴍᴇꜱꜱᴀɢᴇ ʀɪɢʜᴛ ᴀᴡᴀʏ
@deltamakuba
@deltamakuba Жыл бұрын
#PAPAFAM
@0scarDev
@0scarDev Жыл бұрын
pass the code
@AhmadRaza-mw7ux
@AhmadRaza-mw7ux Жыл бұрын
❤️❤️❤️❤️❤️❤️❤️
@induchandana4379
@induchandana4379 Жыл бұрын
superrrrr
@jo3436
@jo3436 Жыл бұрын
did anyone notice at 14:24 how the autocomplete describe the function very accurately!
@MilindaAbeykoon
@MilindaAbeykoon Жыл бұрын
yes. it's github copilot
@ikarosouza
@ikarosouza Жыл бұрын
Short answer: Don't. You won't have a project complex enough so that using redux might actually help.
@SonnySangha
@SonnySangha Жыл бұрын
Bad advice. Completely disagree
@ikarosouza
@ikarosouza Жыл бұрын
@@SonnySangha ok, would you please explain how "keep it simple" is a bad advice?
@abidshahriar
@abidshahriar Жыл бұрын
this redux setup will not work when you add other pages in nextJS
@akirayano3677
@akirayano3677 Жыл бұрын
Why?
@SonnySangha
@SonnySangha Жыл бұрын
Yes it will, I’ve done it many times
@Birendrakumar-en9yi
@Birendrakumar-en9yi 10 ай бұрын
Thanks, uderstood
Learn Next.js 13.4 Server Actions in 24 minutes (For beginners)
24:45
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 182 М.
Каха ограбил банк
01:00
К-Media
Рет қаралды 2,5 МЛН
Китайка и Пчелка 10 серия😂😆
00:19
KITAYKA
Рет қаралды 2,1 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 109 МЛН
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 453 М.
Next.js 14 State Management with Redux Toolkit 2024 | Hindi
1:07:10
Next.js App Router: Routing, Data Fetching, Caching
14:32
Vercel
Рет қаралды 293 М.
Next js Tutorial for Beginners | Nextjs 13 (App Router) with TypeScript
1:02:55
Programming with Mosh
Рет қаралды 533 М.
State Managers Are Making Your Code Worse In React
13:33
Web Dev Simplified
Рет қаралды 155 М.
React Redux Toolkit
28:17
Piyush Garg
Рет қаралды 56 М.
Why I don't use React-Query and tRPC in Next.js
18:58
ByteGrad
Рет қаралды 72 М.
NextJS Tutorial - All 12 Concepts You Need to Know
44:38
ByteGrad
Рет қаралды 238 М.
Каха ограбил банк
01:00
К-Media
Рет қаралды 2,5 МЛН