Тёмный

Redux Tutorial - Beginner to Advanced 

freeCodeCamp.org
Подписаться 10 млн
Просмотров 426 тыс.
50% 1

Learn how to use Redux in this full course for beginners. You will learn how to use Redux with ReduxToolkit Library to create an application involving HTTP requests.
✏️ Nikhil Thadani created this course. Check out his RU-vid channel: / @indiancoders
💻 Code: github.com/Nikhilthadani/Redu...
⭐️ Course Contens ⭐️
⌨️ (0:00:00) Introduction and Overview of Tutorial
⌨️ (0:00:58) Basic Terminologies
⌨️ (0:02:20) Counter App With react-redux
⌨️ (0:16:11) Using Redux Toolkit
⌨️ (0:24:34) Shopping Cart Project - Introduction
⌨️ (0:25:53) Shopping Cart Project - Auth Slice State
⌨️ (0:37:49) Shopping Cart Project - Cart Slice State
⌨️ (0:57:11) Incrementing and Decrementing Items From Cart
⌨️ (1:06:00) Adding Logout State
⌨️ (1:08:03) Using Firebase with Redux
⌨️ (1:11:11) Sending asynchronous HTTP Requests with Redux
⌨️ (1:17:05) Adding Notifications with Material UI
⌨️ (1:19:02) Adding Notification slice state
⌨️ (1:27:24) Using Redux Thunk Pattern
⌨️ (1:28:37) Creating Thunk Pattern with redux
⌨️ (1:32:22) Sending GET HTTP request with Redux
⌨️ (1:40:51) Summary of the course
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 370   
@IndianCoders
@IndianCoders 2 года назад
Thank you, Beau, for sharing this course on the most loved channel of developers. Would love to contribute to this awesome community in future as well ❤️.
@witherin-_-3712
@witherin-_-3712 2 года назад
the creator who spent more than 5 hours making this video. you deserve more credit 👍
@eelguneezmemmedov1671
@eelguneezmemmedov1671 2 года назад
Please Could u make a video with react_redux multi language website Pleaseeee
@wolfdog9409
@wolfdog9409 Год назад
nice video , but is very hard to undestend your english (im from spain)
@darlingharish9338
@darlingharish9338 4 месяца назад
thanks for giving this advanced redux it could be useful for top company placements
@prisinha
@prisinha 2 года назад
my notes requests further correction from learners 2:00 redux terms 2:22 npx create-react-app appName 2:35 cd appName 2:42 npm install redux react-redux 3:00 create folder store inside src folder 3:15 create index file in store folder 3:20 to handle all react states 3:30 redux contains createStore 3:35 store is created from createStore function 3:40 createStore function needs a reducer function as its param 3:45 reducer function to be an arrow function 4:00 reducer function to have two params state and action 4:05 action will have two params type and payload 4:24 initial value of state defined as an object 4:44 app file to contain initial value of state defined as an object 4:50 root file index has to provide access of central store to entire application and root file index contains App component 5:10 react-redux contains Provider 5:25 wrap App component with Provider component in root index file 5:44 export of store component as default 5:50 root file index imports store component and attaches store component as prop to Provider component 6:05 header element and its contents are replaced by 6:30 react-redux contains useSelector function 7:00 useSelector is an arrow function with state as param and returning counter from state 7:30 counter variable assigned to keep outcome from useSelector function 7:40 output of counter passed to UI as JSX 7:45 error in compile 7:50 debug error 8:15 return value of state to reducer function 8:20 possibility of changing initial value of counter 9:00 Increment and Decrement Buttons added 9:15 event handler arrow functions increment and decrement defined 9:40 dispatch an action 10:00 react-redux contains useDispatch function which will help to dispatch an action 10:05 when unique action is provided in App file then index file in store will fetch action 10:15 dispatch variable assigned outcome of useDispatch function 10:40 dispatch function to contain param with key type and value INC in App component 11:00 limitations of reducer function within index file of store folder 11:11 first limitation is on usage of sync function within index file of store folder 11:15 second limitation is mutation of original state not allowed within index file of store folder 11:30 possibility of application crash due to index file of store folder 11:33 copy of original state is allowed within index file of store folder 11:50 if action object has key type which strictly equals INC within index file of store folder 12:45 then assign a new value to counter within index file of store folder 13:15 dispatch function to contain param with key type and value DEC in App component 13:30 if action object has key type which strictly equals DEC within index file of store folder 13:45 then assign a new value to counter within index file of store folder 14:14 Add by 10 button added in App component 14:20 event handler arrow function addBy defined in App component 14:40 dispatch an action within addBy function in App component 14:49 addBy function to return dispatch function to contain param with key type and value ADD along with second param with key payload and value 10 in App component 15:15 if action object has key type which strictly equals DEC within index file of store folder 13:45 then assign a new value to counter within index file of store folder 15:00 sending data from App component to index file of store folder 16:16 redux toolkit 17:00 documentation on reduxjs toolkit 17:11 api included into reduxjs toolkit 17:50 RTK Query helps to mutate state 18:30 npm intall reduxjs toolkit 18:40 reducer function removed from index file of store folder 18:45 reduxjs toolkit contains configureStore and createSlice within index file of store folder 19:00 createSlice function assigns its outcome to counterSlice within index file of store folder 19:15 createSlice function to contain object as its param where first key is name and its value is counter within index file of store folder 19:22 createSlice function to contain object as its param 19:25 where second key is initialState and its value is an object with key counter and value 0 within index file of store folder 22:45 error corrected by colon after initialState within index file of store folder 19:33 createSlice function to contain object as its param where third key is reducers and its value is an object with first key as increment function 20:15 with two params state action which return amended value of counter of state object 23:23 error corrected by removing hard coded value in expression and second key as decrement function 20:24 with two params state action which return amended value of counter of state object 23:23 error corrected by removing hard coded value in expression and third key as addBy function 20:30 with two params state action which return amended value of counter of state object within index file of store folder 23:45 error corrected by addition assignment operator to return amended value of key counter of object state assigned from key payload of object action within index file of store folder 20:42 configureStore function assigns its value to store within index file of store folder 20:50 configureStore function to contain object as its param where first key is reducer and its value is reducer key from object counterSlice within index file of store folder 21:00 export actions with key actions from object counterSlice and 23:00 error corrected by export default store within index file of store folder 21:21 import actions from index file of store folder within App component 21:50 dispatch function will not contain any object with key-value pair as hard-coded values but object with its function within App component 22:22 addBy function within dispatch function within App component 23:33 error corrected by replacing hard coded values by action object with key payload 22:33 error debug 24:00 UI output
@thatsalot3577
@thatsalot3577 2 года назад
Thanks for this, I wish they pin this comment.
@prerakjain6283
@prerakjain6283 2 года назад
Thanks! Super helpful!
@nimishajain3722
@nimishajain3722 2 года назад
Wow...thanks buddy it helped me alot🙏🙏🙏
@AyushKumar-bj6yq
@AyushKumar-bj6yq Год назад
I respect your hardwork it's inexpressible in words
@harshabayyaram
@harshabayyaram 10 месяцев назад
wow
@soumadip_skyy_banerjee
@soumadip_skyy_banerjee 2 года назад
Just when I needed it! Are y'all reading our minds now? 🥺
@ihateorangecat
@ihateorangecat 2 года назад
yeah relatable.
@darsh_shukla
@darsh_shukla 2 года назад
It's happening all over internet for me.
@isaacelinamspielberg5752
@isaacelinamspielberg5752 2 года назад
I think they are Sky B.
@soumadip_skyy_banerjee
@soumadip_skyy_banerjee 2 года назад
@@ihateorangecat hell yeah
@soumadip_skyy_banerjee
@soumadip_skyy_banerjee 2 года назад
@@darsh_shukla Oh achha
@matthayden1979
@matthayden1979 11 месяцев назад
I have gone through many tutorial just to understand how to setup redux. After going through first 12 minutes, I got to know it finally. Excellent step by step explanation!!!
@adrian-mihairosu2274
@adrian-mihairosu2274 2 года назад
A truly amazing tutorial. Fast-paced, well explained, and backed by practice.
@nirajgurung8348
@nirajgurung8348 2 года назад
Thank you, this was a much needed one
@WhatIsMyNameDamnIt
@WhatIsMyNameDamnIt 8 месяцев назад
Thank you. Very nice course, nicely planned, good pace, all clean & clear. Learned a lot.
@ericblancas8113
@ericblancas8113 2 года назад
such an important topic to cover in the javascript / react ecosystem. Some devs out there really under value redux ever since context api was introduced but a good majority of the market still uses redux, plus context imo is seen more as a dependancy injection rather than state management.
@MuhammadYasirGhaffar
@MuhammadYasirGhaffar 4 месяца назад
Exactly what i wanted (introduction with a small project and then implementation with a bigger project).
@vincent3542
@vincent3542 2 года назад
Exactly what I needed!!
@HuziDev
@HuziDev 2 года назад
you've to be more specific about what every functions are doing and why we are doing export, counteSlice.actions etc
@gng75
@gng75 2 года назад
Waiting for this course .🤝👍
@breakingnewskarimganj9505
@breakingnewskarimganj9505 Год назад
Damn! Worked like a charm! Thank you soooo much!
@paranoid.dharma
@paranoid.dharma Год назад
It's for the people who already know redux and wants to revisit, otherwise beginners will end up scratching their heads.
@geoafrikana
@geoafrikana Месяц назад
If you're struggling with this then it means you aren't familiar with useReducer. IMO, anyone who isn't familiar with useReducer has no business with Redux.
@shubhampatil5935
@shubhampatil5935 Год назад
This guy is teaching to those who knows redux very well...
@ashrabessential1110
@ashrabessential1110 Год назад
Exactly his teachings are not simplified atall Let them bring in pierce harbor
@aravindbhaddriraju1864
@aravindbhaddriraju1864 10 месяцев назад
exactly....he is not giving basic explanation also
@ojokorede4510
@ojokorede4510 Год назад
I haven't started but i already have a feeling that it will be interesting and smooth.
@john74719
@john74719 2 года назад
Great Tutorial, *I will now work on my project*
@mahendranath2504
@mahendranath2504 2 года назад
Thank you so much for your support and for a great video 👍🏼⭐🎉🙏🤛
@MissBoom135
@MissBoom135 Год назад
Before I watched this tutorial, I really struggled to understand Redux. But this tutorial has massively helped me understand Redux better, so thank you for an excellent tutorial!!
@tijuanaiguana190
@tijuanaiguana190 Год назад
What is this for? What is a redux for?
@dishantyadav2533
@dishantyadav2533 Год назад
Thanks for this wonderful tutorial!
@salesforceWithParamita
@salesforceWithParamita Год назад
Thank you so much . It's a great tutorial.
@virajmahida1655
@virajmahida1655 Год назад
Thanks a lot Nikhil, Watched full tutorial, Helped a lot.😃
@luffythestrchykid
@luffythestrchykid 2 года назад
Huge thanks from the community.
@AncientSocrates
@AncientSocrates 2 года назад
Just started the redux tutorial of free code camp, thanks for this.
@zancrow_gaming
@zancrow_gaming 11 месяцев назад
The best tutorial. Helped me to understand redux toolkit
@sanjarcode
@sanjarcode 2 года назад
Needed this badly.
@droidsage730
@droidsage730 2 года назад
great timing.. i just started learning React
@zakiarahmoune7458
@zakiarahmoune7458 2 года назад
Very Helpuful, Thank you very much Sir!
@lynnalhaimy
@lynnalhaimy 10 месяцев назад
Thank you, I've learned a lot about Redux from your video.
@reomoromiu3680
@reomoromiu3680 2 года назад
That's Great! Thank you so much.
@behnamparsaeifard3883
@behnamparsaeifard3883 2 года назад
Great instruction! Just a little question: when did you add dispatch to useEffect dependencies and why you added that? Is it necessary? What does it do?
@jsr7599
@jsr7599 2 года назад
I'm getting into react now and noticed a lot of people simply refer to using the context API as opposed to redux, stating that only complex projects need redux. How does one know when to use one over the other without years of experience? What features / caveats will push one towards utilizing redux in their project?
@guidolopez664
@guidolopez664 2 года назад
You'll know, it literally will came in to your view as a solution and you will feel the need to use it. As I can say, use Redux if you're dealing with too much global states and too much updates of them.
@aidanoconnor8319
@aidanoconnor8319 2 года назад
context is good for static values or when components are using the whole of the state context, if you have many components only using part of the state something such as redux is better. this is because your components using part state will be re-rendered when the context state is updated even if the value doesn't directly effect the component
@zhunter8596
@zhunter8596 2 года назад
I was waiting for this
@abhishekk1231
@abhishekk1231 2 года назад
Thank you for the video!
@hamzamaimoune1513
@hamzamaimoune1513 Год назад
Thank you very much for making this free, may God reward you
@itachi-senpaii
@itachi-senpaii 2 года назад
*Thank you so much ... It is very helpful ... You are awesome ...*
@tarike9808
@tarike9808 11 месяцев назад
clear and concise
@SwagatVlogs
@SwagatVlogs 2 года назад
Please give proper pause and speak slow in your next videos. You sound nervous and the users have to pause or scramble more through the video to understand what you are trying to convey. Overall, this video was informative and detailed. Thank you.
@LifeAtMH41
@LifeAtMH41 Год назад
Thanx for this tutorial man. It really helped everyone. I have a few questions. I am developing a shopping application. I have a list of products on the homepage. Each product have 'favorite' toggle icon. The toggle icon is will change the color once I click it(favorite and unfavorite). I am showing the based based on the property 'isFavorite' present in that product's object. Now my requirement is. 1-How to change the state of the favorite product into the redux state when I toggle favorite any item? I have maintained two states in my redux store, favorites: [] and allProducts: []. When I add or remove anything into the 'favorite' array I have to toggle the 'isFavorite' property of that product into the 'allProducts' array. Any help would be appreciated. Thank you.
@yyxx9309
@yyxx9309 2 года назад
Man I love you guys... Whenever I need to learn something for my project, you guys have it.. Do you read my mind???
@ayushsharma6089
@ayushsharma6089 Год назад
I recommend to go throught the redux from the tutorial point then do watch this video to grasp the knowledge .. I did it in this way.
@robertobenedit
@robertobenedit 2 года назад
fantastico!
@mahendranath2504
@mahendranath2504 2 года назад
Thanks you so much 👍🏼🙏🎉⭐
@WinchesterD
@WinchesterD 4 месяца назад
Thanks for the course.
@aslen3765
@aslen3765 2 года назад
Hello! You should do a long video on C, I think a lot of people (myself included lol) would appreciate it!
@worldclasscode1847
@worldclasscode1847 2 года назад
Great Video ! :)
@aufabillah6883
@aufabillah6883 2 года назад
Waw nice tutorial 🤩
@czancdy144
@czancdy144 Год назад
i thought it was a Beginners course, but this man is in his own world. sorry to say that
@reader-7623
@reader-7623 Год назад
i agree, i cant follow his fast-paced explanation😢
@ashrabessential1110
@ashrabessential1110 Год назад
He isn’t even explaining atall
@ashankarunaratne3424
@ashankarunaratne3424 Год назад
yeah man seriously
@knowledgedose1956
@knowledgedose1956 Год назад
Agree, very fast
@milknei_beats
@milknei_beats Год назад
he's just indian lmao
@thanakronjantara6421
@thanakronjantara6421 Год назад
35:32 // tp login 43:25 // tp cart 44:13 // index store 46:03 // use store cart
@ameyapathak2008
@ameyapathak2008 2 года назад
Nikhil bhai . 👍👍👍
@riyazahmed3231
@riyazahmed3231 Год назад
Thank you for the tutorial, i tried to develop one small app using redux toolkit, however , i have one bug , can't rectify?
@ahmedbousaleh1018
@ahmedbousaleh1018 4 месяца назад
OH thank you so much youtube for creating the subtitles and thank u for the video it really helpfull
@arseneawounou180
@arseneawounou180 2 года назад
Thank you very much
@sarrthecode
@sarrthecode 2 года назад
This is insane you guys are mind readers
@M25870
@M25870 2 года назад
This is just feedback and not hate. By talking more slowly, you can improve your accent and we can understand more clearly what are you saying :)
@sawankumardas7384
@sawankumardas7384 Год назад
How are you able to use `createStore` as this function that has not been officially deprecated in Redux as of my knowledge cutoff date (September 2021).
@mohamadnagiebrahim
@mohamadnagiebrahim Год назад
Why exactly do we need to add the second thunk pattern, the fetchData one ? Not sure if I fully understand the Thunk method in redux!!
@abigiyatadesse2672
@abigiyatadesse2672 Год назад
Thanks a lot.
@WarrenBey
@WarrenBey 2 года назад
I don't think the HOW without the WHY approach to teaching is very good.
@RaghavendraGowda7
@RaghavendraGowda7 Год назад
Cannot read properties of undefined (reading 'find') if you counter this issue , Please add "state.itemsList = action.payload.itemsList ?? [];" in replaceData method of store cart-slice.js. Hope it helps someone :)
@eriqhbal
@eriqhbal Год назад
thankyou so much
@rudra6219
@rudra6219 2 года назад
Thankyou Dev team 😍
@rasimhesenov3848
@rasimhesenov3848 2 года назад
Thank you bro
@malikkorede3592
@malikkorede3592 Год назад
Hi, i got this error while trying to checkout from the StartingApp error: pathspec 'StartingApp' did not match any file(s) known to git
@raghavambashta
@raghavambashta Год назад
I thought of following along the video but there is no source code. So, gonna find some another course
@mrrishiraj88
@mrrishiraj88 2 года назад
Thanks
@willyhorizont8672
@willyhorizont8672 2 года назад
thanks bahut badhiya
@009freestyler
@009freestyler 2 года назад
How do use Redux to show data on page load ? I have an action in my slice to fetch all data from a REST API, then I dispatch that action from useEffect but it doesnt work :( 😢😭😞
@user-ck1sd3zs7u
@user-ck1sd3zs7u 4 месяца назад
Thank you
@theatypicaldeveloper
@theatypicaldeveloper 2 года назад
if you're working with react it's mandatory to learn some state managing library (pref redux). It's also worth to mention that redux has released redux-toolkit (supposedly easier to use ), with built in utilities and it's powerful too. Oh and almost forgot, great content!
@joe86569
@joe86569 2 года назад
has people started using redux toolkit in real world projects?...most projects might still use the normal redux
@theatypicaldeveloper
@theatypicaldeveloper 2 года назад
@@joe86569 hey, yep redux-toolkit is quite popular already :). I'd agree that most projects still use redux, but that's quite normal. I wouldn't refactor my whole redux setup along with all utils just to replace it with redux-toolkit. Although when starting a new project people tend to choose redux-toolkit over redux.
@SandeshMotoVlogs
@SandeshMotoVlogs 2 года назад
Am i the only one who thinks redux toolkit is difficult than vanilla redux?
@fiifiyawson8397
@fiifiyawson8397 2 года назад
@@SandeshMotoVlogs your are not alone in this
@yuvrajsingh7226
@yuvrajsingh7226 2 года назад
That Indian accent 🤍! Love you so pleased to learn
@iamsajjadalidev
@iamsajjadalidev Год назад
Thanks a lot
@anasmak1337
@anasmak1337 2 года назад
thaat whaat i waant thank you
@niharikadeshmukh3914
@niharikadeshmukh3914 Год назад
Help me resolve my scenario, I am using redux for nested material table. While moving parent to child table my redux details are getting blank… please suggest me for the solution
@ritikarohatgi7287
@ritikarohatgi7287 7 месяцев назад
Getting an error ( around 40:17 mins into the tutorial) when creating the cartSlice Reducer in cart-slice.js . I have written the same code and everything was working fine till now. WHen defining the addToCart reducer, it shows " Signature declarations can only be used in TypeScript files.ts(8017)" . Not sure why am getting this error, have written same code . If anyone else facing similar issue, please HELP. Stuck here!!
@lordknighton
@lordknighton 2 года назад
I feel this guy talks like The Flash runs, but all in all grateful for the content.
@thanushb3324
@thanushb3324 Год назад
Atlast the number of acart items are not shown in top... im getting NaN cart... can anyone help i think some problem with cart.totalQantity
@kietle5340
@kietle5340 2 года назад
state.counter++ and ++state.counter. the first one return state.counter before executing plus operation, and the rest is versa.
@mohammedrashad1
@mohammedrashad1 2 года назад
Please, a detailed tutorial for flutter Getx
@tophr5550
@tophr5550 2 года назад
Just at the right time
@eMeN903
@eMeN903 2 года назад
thank you sir
@TechOasis101
@TechOasis101 Год назад
The createStore is deprecated and i can't find a single video where some one is using the configureStore
@AbdulRehman-ui3nj
@AbdulRehman-ui3nj Год назад
update plz now, createStore() is replaced by configureStore()
@samarthm4582
@samarthm4582 Год назад
The best redux video ever!! Well done buddy!!
@sunilkarki6013
@sunilkarki6013 Год назад
great video
@sumakosuri6505
@sumakosuri6505 Год назад
Hi, Can't find code in the github repo. Is it removed? Can anyone share the github link please.........
@harshitsamdhani2426
@harshitsamdhani2426 Год назад
thank you
@adityamarzuk5970
@adityamarzuk5970 10 месяцев назад
You should know use reducer use context use state before learning redux it will make a lot easier to understand
@eelguneezmemmedov1671
@eelguneezmemmedov1671 2 года назад
Guys how can we make a multilanguage website with react redux ?
@racheledwards5841
@racheledwards5841 10 месяцев назад
Any English version of this tutorial please?
@arjunkhanna8063
@arjunkhanna8063 Год назад
What's the extensions that enables you to autocomplete the code and also tells you the argument types??
@SurajGupta-px2xh
@SurajGupta-px2xh Год назад
you can use sublime text editor.
@iknowyouknow596
@iknowyouknow596 2 года назад
Where is the address of the github repository for this course?
@saikumar7247
@saikumar7247 7 месяцев назад
create store not working and not importaing what should we do
@liranEX
@liranEX 2 года назад
The explanation are all over the place.
@iGhostr
@iGhostr 2 года назад
Flutter Redux ❤️
@atraps7882
@atraps7882 8 месяцев назад
trying to become a better front-end dev as a mostly backend specialized dev... full-stack one day!!!
@unjinjang2234
@unjinjang2234 2 года назад
Amazing guide! I have a small question regarding your redux normalization, shouldn't it be more complex when it comes to creating a normalization for redux? Or did you design the normalization for this project simple since it's just a beginner tutorial?
@currenttoff1753
@currenttoff1753 2 года назад
1:37:27 replaceData(state, action) { state.totalQuantity = action.payload.totalPrice; state.itemsList = action.payload.itemsList; }, can anyone explain why he has written state.totalQuantity = action.payload.totalPrice;
@Mr-hq6ox
@Mr-hq6ox 2 года назад
It was a mistake, it should be: replaceData(state, action) { state.totalQuantity = action.payload.totalQuantity; state.itemsList = action.payload.itemsList; },
@bhavinkhunt2496
@bhavinkhunt2496 2 года назад
please upload the code in github website because your code is not visible
@grandkarpovgm4942
@grandkarpovgm4942 Год назад
If I will now say that you are doing good work, then , if i will now thank you for putting in the effort. 😂😂 There were a lot of " if i will now" in this tutorial , but i am not mocking you, you have been very helpful, despite the " if i will now's" Seriously, thanks
@JhourladEstrella
@JhourladEstrella Месяц назад
Vat is "campo nents"? Haw abawt "beten selecter"?
Далее
Learn Redux Toolkit in under 1 hour
58:10
Просмотров 126 тыс.
Redux Tutorial - Learn Redux from Scratch
1:34:53
Просмотров 1,1 млн
Redux - Complete Tutorial (with Redux Toolkit)
37:01
Просмотров 173 тыс.
React State Management - Intermediate JavaScript Course
2:46:38
NestJs Course for Beginners - Create a REST API
3:42:09
Redux For Beginners | Redux Tutorial with Redux Toolkit
55:10
Redux For Beginners | React Redux Tutorial
39:43
Просмотров 1,2 млн