React Shopping Cart Tutorial | Context API with useReducer Hook in React JS

#reactshoppingcart #useContext#ReactJSProject #useReducer
Build a Shopping Cart Project in React JS in one video. We will use Context API with useReducer Hook for State Management. Learn Hooks like createContext and useContext. We will learn add to cart functionality along with sorting and filtering products by search also.
Source Code -
github.com/piyush-eon/React-s...
Live Site -
shopping-cart-with-reactjs.ne...
If any questions, ask here -
/ roadsidecoder
Context API Tutorial -
• React Context API with...
React Router Tutorial -
• React Router Dom [ Ful...
00:00:00 Intro
00:00:24 Project Overview
00:02:53 Initialize new React App
00:03:23 Setup React Bootstrap
00:05:29 Header Component
00:12:05 Creating Page Routes
00:14:43 Setup Context API
00:17:10 Generating Products JSON
00:20:09 useReducer Hook
00:23:43 useContext Hook
00:24:19 Home Page UI
00:28:13 Filter Component UI
00:30:55 Rating Component UI
00:35:27 SingleProduct Component UI
00:40:04 Add / Remove from Cart Functionality
00:45:20 Header Cart Dropdown
00:50:21 Cart Page
01:00:00 Change Cart Quantity Functionality
01:01:53 Filters Implementation
01:02:18 Filters useReducer
01:12:22 Transform Products Logic
01:16:44 Mobile Responsive Styles
01:17:56 Outro
Movie App in React JS and Material UI -
• Movies and TV Series S...
Quiz App in React JS and Material UI -
• Quiz App in React JS w...
Dictionary App in React JS and Material UI -
• 12 Language Dictionary...
Learn React From Scratch -
• React JS Workshop Day ...

Пікірлер: 439

  • @RoadsideCoder
    @RoadsideCoder2 ай бұрын

    My Complete Frontend Interview Prep Course - roadsidecoder.com/course-details (50% Discount for limited time)

  • @rajat4002
    @rajat40023 жыл бұрын

    Whoever is watching this video, let me tell you one thing. You'll be asked to make such project in your frontend interview. Make the most use of this video. Thank you for putting such an amazing content on KZread bhai 😍❤️

  • @RoadsideCoder

    @RoadsideCoder

    3 жыл бұрын

    Yes, It'll be very helpful in machine coding round.

  • @Sky-yy

    @Sky-yy

    3 жыл бұрын

    Thank you for your comment to let others know the importance of this video bro

  • @sudhanshumishra935

    @sudhanshumishra935

    2 жыл бұрын

    Yes, i got an assignment which was exactly similar to this 3 days ago, but sadly i coudln't implement the filter functionality......anyways now i have learnt about state management through this video

  • @shujathaliirfan2662

    @shujathaliirfan2662

    2 жыл бұрын

    I agree

  • @ssumit196

    @ssumit196

    2 жыл бұрын

    thanks buddy, I was just wondering about this.

  • @vamsikrishna7957
    @vamsikrishna79572 жыл бұрын

    Great tutorial!!If anyone is getting a blue background in Navbar dropdown badge,set {10}..the background color gets removed.

  • @Dhivyathaya
    @Dhivyathaya Жыл бұрын

    Thank you for uploading it, Piyush. It's really helpful for us to understand the concept. I can see the hard work and effort you put into it. Once again thank you.

  • @BrijeshSingh-dp1ku
    @BrijeshSingh-dp1ku2 жыл бұрын

    Please keep making such tutorials these are really great 👏

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Thank you, I will

  • @purangurung4559
    @purangurung45592 жыл бұрын

    for route we can use

  • @davidbaraiya2649

    @davidbaraiya2649

    Жыл бұрын

    Yes this is v6

  • @sumittimori834

    @sumittimori834

    Жыл бұрын

    You could've told for FAKERJS alternative faker doesn't work anymore or is it

  • @chetandhadd321

    @chetandhadd321

    Жыл бұрын

    @@sumittimori834 they bro...im getting error The above error occurred in the component any help

  • @AmitGhosh-lj3oc

    @AmitGhosh-lj3oc

    Жыл бұрын

    @@sumittimori834 did you find any alternative?

  • @PeterMehr

    @PeterMehr

    11 ай бұрын

    @@AmitGhosh-lj3oc You can use @faker-js/faker instead: --> install it with: npm install @faker-js/faker --> then import it in Context.js: import { faker } from '@faker-js/faker'; --> and then use it in Context.js: const products = [...Array(20)].map(() => ({ id: faker.string.uuid(), name: faker.commerce.productName(), price: faker.commerce.price(), image: faker.image.url(), inStock: faker.helpers.arrayElement([0, 3, 5, 6, 7]), fastDelivery: faker.datatype.boolean(), ratings: faker.helpers.arrayElement([1, 2, 3, 4, 5]), }));

  • @jugalsuthar9751
    @jugalsuthar97513 жыл бұрын

    such a great session I learn so many things from this video...thanks and make more videos like this..

  • @debasmitamallick6489
    @debasmitamallick6489 Жыл бұрын

    This project is just awesome! I learned a lot from this video. Thanks a ton❤

  • @oncoding4520
    @oncoding452011 ай бұрын

    Have been seen some of your videos and you are really a great teacher. Please keep doing some more content for us :)

  • @AshishGupta-be2yz
    @AshishGupta-be2yz Жыл бұрын

    Very amazing project with indepth explanation. Learned many of new things related to reducer. Thanks a lot bhai.

  • @anonimato1987
    @anonimato1987 Жыл бұрын

    I am so greatful for the "!important" trick. This is the first time I'm seeing this. So useful!!! Thank you so much!

  • @RoadsideCoder

    @RoadsideCoder

    Жыл бұрын

    Glad it was helpful!

  • @Hrit
    @Hrit Жыл бұрын

    This is actually a very clean way to write a shopping cart. Thanks for the video man!

  • @user-bk3hp4zw4l

    @user-bk3hp4zw4l

    Жыл бұрын

    Bro can you forward the link of your shopping cart code bro

  • @elad3958
    @elad39582 жыл бұрын

    Thank you brother, I became an instant fan of your work/channel.

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    🙏🙏

  • @ndahayokevin7626
    @ndahayokevin76262 жыл бұрын

    Incredible I love your tutorials, you are on of the best Tech youtubers I like most

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Thanks a lot 🙏

  • @noobCoder26
    @noobCoder262 жыл бұрын

    I am learning a lot from this channel man .I dont understand why this channel is so underrated

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    You can change that by sharing it to more people 😁🙏

  • @noobCoder26

    @noobCoder26

    2 жыл бұрын

    @@RoadsideCoder I am doing that for sure

  • @Admin-up4hh
    @Admin-up4hh Жыл бұрын

    Very underated Video . This is what I wanted... Thanks ..💯

  • @mishka.g8462
    @mishka.g8462 Жыл бұрын

    That's really great!! keep going!!!🤩

  • @bardhan.abhirup
    @bardhan.abhirup Жыл бұрын

    Hey, firstly, thanks a lot for your tutorials and interviews. I genuinely feel like I've learnt a lot through them Having said that, if you don't mind a bit of feedback, your naming conventions and general consistency needs some attention. I feel it's all over the place. I know during the interview demos you tend to code faster but in these expositions when you have the luxury of time, i think it's worth paying attention to since you have a lot of viewers. Just my opinion. Regardless of that, I highly appreciate the effort you put in to your content. Thanks once again!

  • @RoadsideCoder

    @RoadsideCoder

    Жыл бұрын

    Hey, Thanks a lot for your feedback. And I have improved this in my recent videos after realising this. ❤️

  • @parvathyvd
    @parvathyvd Жыл бұрын

    Thank you so much for making such a wonderful project.

  • @sk199
    @sk199 Жыл бұрын

    your projects are super helpful brother..⭐❤

  • @niranjanjathar3748
    @niranjanjathar37482 жыл бұрын

    Thanks for such a great video on context api

  • @user-pb5dy5th3z
    @user-pb5dy5th3z2 жыл бұрын

    Thank you for your kind explanation! btw I wonder if there is a way to lose focus on the green cart button at "50:15" when moving to the cart page. I tried document.activeElement.blur() but it doesn't work. Probably it's hard to control the bootstrap component?

  • @jenso413
    @jenso413 Жыл бұрын

    For anyone else curious about the Array(prod.inStock).keys(); evidently keys() is also an array method! I thought it was just an object method. What he is doing here is creating an array the length of the number of products in stock. For example, if there was 5 products in stock, there would be an array with 5 elements (all undefined initially). Then, the keys method converts an array to an iterable object with the array keys(indexes). This is then spread into an array and mapped over, essentially making each array element an index. I think a simpler and more understandable solution would simply be to use the index parameter from the map function, the result seems to be the same.

  • @usamaarifshah7499

    @usamaarifshah7499

    Жыл бұрын

    hey

  • @fahadahmed3508

    @fahadahmed3508

    Жыл бұрын

    @@usamaarifshah7499 Thanks for the explanation!

  • @2784raj
    @2784raj Жыл бұрын

    you are awesome mentor, well done mate!

  • @IvinAustan
    @IvinAustan Жыл бұрын

    Thanks a lot, such an great video with nice explanation. 👍

  • @shamaunnabi3508
    @shamaunnabi35082 жыл бұрын

    You are Just Amazing ....We need More Tutorial Like This....Please Upload More Beginner Projects

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Thank you, I will

  • @mohitsaud2071
    @mohitsaud20712 жыл бұрын

    Thank you for this wonderful tutorial.

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Welcome mate

  • @sohadmad1823
    @sohadmad1823 Жыл бұрын

    I can't express how much I am grateful to you, you really saved my life! Thank you very much, you are the best instructor I've learnt with him!

  • @RoadsideCoder

    @RoadsideCoder

    Жыл бұрын

    You're welcome ❤️

  • @user-vu9dl3vn7l
    @user-vu9dl3vn7lАй бұрын

    It's a great video! Thanks a lot!

  • @mma-dost
    @mma-dost2 жыл бұрын

    Thank you Bhaiya for this tutorial. Really great video 🔥🙏👌❤️👍👍

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    🙏🙏

  • @abubakaryasin8610
    @abubakaryasin86103 жыл бұрын

    I learned a lot from you Great content

  • @RoadsideCoder

    @RoadsideCoder

    3 жыл бұрын

    Thanks man. ❤️

  • @tirielross
    @tirielross Жыл бұрын

    Thank you very much professor for this amazing project, this opens and expands my knowledge to know more about Reducer, provider state, etc.

  • @RoadsideCoder

    @RoadsideCoder

    Жыл бұрын

    Glad to hear that !

  • @BrijeshSingh-dp1ku
    @BrijeshSingh-dp1ku2 жыл бұрын

    Best resource for React 🔥🙌

  • @krutidewda3152
    @krutidewda31524 ай бұрын

    very useful video. Thankyou so much for this.

  • @RoadsideCoder

    @RoadsideCoder

    4 ай бұрын

    Thanks! I have created an indepth course covering all such topics - roadsidecoder.com/course-details

  • @vaibhavjadhav1702
    @vaibhavjadhav170210 ай бұрын

    thank you for this amazing project🙂

  • @alextalha_
    @alextalha_2 жыл бұрын

    the best video by contextApi

  • @azizulhakim1534
    @azizulhakim15342 жыл бұрын

    amazing content brother. You deserve more subs, One request: if possible please use a loud microphone.

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Thanks brother, I'll improve the audio quality 🤘

  • @chiranjeevichowdary5948
    @chiranjeevichowdary59483 жыл бұрын

    Waited for this a long time

  • @RoadsideCoder

    @RoadsideCoder

    3 жыл бұрын

    Haha yeah

  • @MrAndykofi
    @MrAndykofi2 жыл бұрын

    Great job, thanks for sharing

  • @Ravikumar-wv2xq
    @Ravikumar-wv2xq Жыл бұрын

    hello sir great tutorial perfect combination of useReducer and contextAPI. it's working same as like as redux.

  • @vinayakjaimini7716

    @vinayakjaimini7716

    6 ай бұрын

    hiii bro i am facing problem in running this project can u help

  • @abdulrakib9906
    @abdulrakib99063 жыл бұрын

    Really great video. I am looking something like that. Thank you very much..

  • @RoadsideCoder

    @RoadsideCoder

    3 жыл бұрын

    Glad u liked it 🙏

  • @tanjimanim2391
    @tanjimanim2391 Жыл бұрын

    This is a great tutorial. I used this in my project and I want to point out two things. 1. the store/global state will be gone once the page refreshes. Use localstorage to store that. 2. The reducer function used in this video are not pure functions, as you are assigning values on reducers, which is not a good practice.

  • @oussamaaitboulahna4849

    @oussamaaitboulahna4849

    Жыл бұрын

    Hi brother , can u tell me how did u store ur data into localstorage and fetch it again , cuz for me im only get [object,object] ??

  • @tanjimanim2391

    @tanjimanim2391

    Жыл бұрын

    @@oussamaaitboulahna4849 share your code brother

  • @shariqansari4056

    @shariqansari4056

    Жыл бұрын

    @@oussamaaitboulahna4849 Convert your data into string , then store in local storage.

  • @oussamaaitboulahna4849

    @oussamaaitboulahna4849

    Жыл бұрын

    @@shariqansari4056 Oh Thanks Man

  • @abbaskagdi1

    @abbaskagdi1

    Жыл бұрын

    This comment needs to be on top

  • @korndev6862
    @korndev68622 жыл бұрын

    Great Tutorial. i would like the react + typescript + combine reducers tutorial plz.

  • @iqbal5942
    @iqbal59423 жыл бұрын

    you deserve more subscribers and likes 💖

  • @RoadsideCoder

    @RoadsideCoder

    3 жыл бұрын

    Thanks man. You can support me by sharing this to people who need it.

  • @saurabhtiwari-kg9vn
    @saurabhtiwari-kg9vn Жыл бұрын

    Bhai kya khate ho 🤔 itna energy rahta hai 😄 Bhokal video h 🔥🔥

  • @baridzimaximillem6743
    @baridzimaximillem67432 жыл бұрын

    You are amazing man keep it up

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Yo thanks mate!

  • @sushmitagupta
    @sushmitagupta2 жыл бұрын

    Great tutorial! It helps me a lot while adding some feature in my E-commerce project but I'm using my own database and I have not added the "inStock" in my database so can you please tell me how can I add that and use in the qty increment feature of cart cards.

  • @Ajithmani-bm1ji

    @Ajithmani-bm1ji

    Жыл бұрын

    You got a answer

  • @alanouri9965
    @alanouri9965 Жыл бұрын

    Thank you man!

  • @l.seciltuncay7921
    @l.seciltuncay7921 Жыл бұрын

    great tutorial ⭐⭐⭐⭐⭐ thanks

  • @souleymanecisse8644
    @souleymanecisse86442 жыл бұрын

    Great content , thanks for sharing

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Glad you liked it 🙏

  • @mprasanth18
    @mprasanth18 Жыл бұрын

    In interviews is it okay to use plain css modules instead of bootstrap?

  • @namethse01
    @namethse01 Жыл бұрын

    thanks bro, though manything outdate and alot update after time, but it still a good tutorial to start and easy to understand

  • @navinkumarsahu1159
    @navinkumarsahu1159 Жыл бұрын

    Please bring more such contents

  • @TajminurRahmanmeshadowscream
    @TajminurRahmanmeshadowscream2 жыл бұрын

    Great tutorial. So much helpful. I have a question though. How to initialize state with products from API call? Because you're loading dummy products which are synchronised call. How about an async call using API? I tried but the initial state in useReducer initialized first before the products from API get loaded. What do you think?

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    You can do it the same way, that dummy data is also the result of an api call from faker

  • @garima6571
    @garima6571 Жыл бұрын

    Great man

  • @akashawasthi9515
    @akashawasthi95152 жыл бұрын

    utub recommending this piece of work

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Awesome 🔥

  • @parmaryash4406
    @parmaryash44062 жыл бұрын

    Amazing

  • @alphonsesossou4283
    @alphonsesossou4283 Жыл бұрын

    Thanks so much for this awesome course. I am making an excellent use of it. Only one minore issue. Children props is flagged with the error message "Children is missing in props validation". I am using react app created through latest vite. Any hint on what to add to the app so that error disappears? I should mention that the context provider function in jsx nor js.

  • @meidadb5992
    @meidadb5992 Жыл бұрын

    Thank you❤️

  • @vaibhavsharma8012
    @vaibhavsharma80126 ай бұрын

    Good Project

  • @MrPeepa
    @MrPeepa2 жыл бұрын

    "A is only ever to be used as the child of element, never rendered directly. Please wrap your in a " what to do if i get this error?? because if i wrap with it says [home] is not a react component or react.fragment

  • @chafikgouasmia8089
    @chafikgouasmia80892 жыл бұрын

    Thanks dear oracle : )

  • @Insane.18_7
    @Insane.18_78 ай бұрын

    Hi bro thank you so much. You helped me a lot by sharing this content ❤. Can I know one thing, is this responsive, I mean is this compatible for smaller devices like mobile applications?

  • @NCS8331
    @NCS83316 ай бұрын

    thank you

  • @GauravPatel-kh1sq
    @GauravPatel-kh1sq2 жыл бұрын

    Very Nice explanation with real project. thank you. Can you create/share video with Backend API calling like realword application?

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    I already have a mern stack tutorial series. You can check it out!

  • @lle5159
    @lle51592 жыл бұрын

    This is too awesome, I've learned a ton by this video. Thank you very much! Just a little question: `alignRight` in is not working in my end. Has anyone caught the same thing?

  • @kelongFX

    @kelongFX

    2 жыл бұрын

    yes it says something about the dom i didnt quite get it

  • @lle5159

    @lle5159

    2 жыл бұрын

    @@kelongFX I use CSS to align the dropdown menu, that I set position: relative for container and position: absolute for dropdown-menu

  • @cat_onthe_

    @cat_onthe_

    2 жыл бұрын

    Remove 'alignRight' and add Worked for me.

  • @andress9525

    @andress9525

    2 жыл бұрын

    You can add inline styling to the tag like so: style={{ alignRight: true }}

  • @nobodyneedstoknow128

    @nobodyneedstoknow128

    Жыл бұрын

    align={'end'}

  • @miansaqlain8360
    @miansaqlain8360 Жыл бұрын

    Thank you Sir

  • @purusharma8192
    @purusharma8192 Жыл бұрын

    Please make more react projects....thanks a lot btw are you in akshay saini discord voice chat on first day😁

  • @RoadsideCoder

    @RoadsideCoder

    Жыл бұрын

    Yes i was

  • @huyenminh2631
    @huyenminh26312 жыл бұрын

    From VietNam thanks you so much

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Welcome 🤟

  • @sahanan7117
    @sahanan71172 жыл бұрын

    Hi.. In creating page router, I have written same code as yours but their is error in my output... Please help me out

  • @sushilkumar-ef7gh
    @sushilkumar-ef7gh Жыл бұрын

    Only when components need lot of different state than , its recommended to use state hook else switch on reducer or redux

  • @anhduc97hn
    @anhduc97hn Жыл бұрын

    can someone explain the `onClick` props in rating component for me please? why they're so different in `filter` and `rating` components? thanks!

  • @devsingal8373
    @devsingal83732 жыл бұрын

    thank you bhaiya so much this hepls a ton, i was stuck in my cart app but this helped me get a new perspective thank you so much can you also make full working ecommerce website video plzzzzzzzzzzzzzzzzzzzzzzzzzzzz

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Yeah sure bro!

  • @manojsuggala4666
    @manojsuggala4666 Жыл бұрын

    Good video with clear Explanation. I tried implementing this project, But I didn’t get the output. I got an error saying that: Module not found ‘Faker’ can’t resolve in src/context/context.js. Even I install the package by npm install faker, the error is not re-solving. Can any one help me in resolving the error Thanks in Advance.

  • @phuquang8558
    @phuquang85582 жыл бұрын

    very good

  • @islamel7adidy898
    @islamel7adidy898 Жыл бұрын

    بتتكلم اسرع من حياتي م براحه ي غالي

  • @nishantbindhani9434
    @nishantbindhani943410 ай бұрын

    how is ur dropdown menu position like this (end of dropdown menu container is aligned with the end of dropdown button)

  • @saichaitanyaemandi6386
    @saichaitanyaemandi6386 Жыл бұрын

    bro thanks a lot

  • @nikolozmacharashvili1212
    @nikolozmacharashvili1212 Жыл бұрын

    complicated video, took a while for me to understand the useState hook, but a good job overall...

  • @himankshu
    @himankshu5 ай бұрын

    So what will happen if you add some items and then hard refresh the page? Does the cart items updated to its initial state? If yes, how would you fix it?

  • @celticspyd5887
    @celticspyd58874 ай бұрын

    sir i want to know If a customer clicks on order btn to order and the order list should received at the admins page/panel without any database or backend possible?? if yes how sir?

  • @blah9960
    @blah99602 жыл бұрын

    Hey thanks for awesome tutorials. Please make a video on redux persist and how user are not able to see persist local storage data in production level

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    Hey, Have you followed my MERN Stack Tutorial with redux?

  • @blah9960

    @blah9960

    2 жыл бұрын

    @@RoadsideCoder yes i followed but there is no redux persist implementation

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    @@blah9960 I have done it, in our store.js when the app loads, it takes user from localstorage

  • @priyankashingne8143
    @priyankashingne8143 Жыл бұрын

    This is really helpful video i m trying to create a same project but i m getting problem to access faker

  • @simranmundada
    @simranmundada2 жыл бұрын

    I am getting module not found error which says can't resolve faker in my project

  • @shujathaliirfan2662
    @shujathaliirfan26623 жыл бұрын

    superrrr bro

  • @RoadsideCoder

    @RoadsideCoder

    3 жыл бұрын

    Thanks man

  • @rounakbhattacherje3426
    @rounakbhattacherje3426 Жыл бұрын

    in the filter component for the stars , the onClick prop is receiving back the (i=index) from its Rating component , but in react data flow direction is unidirectional, so how is this phenomenon possible??? anybody who understood- care to explain, (i m very new to react, hence this is something very new to me). Thanks in advance

  • @kacperj780
    @kacperj7802 жыл бұрын

    hey how do you import components by just clicking at underlined red text in your code? is it some extension?

  • @width19

    @width19

    Жыл бұрын

    same, i didnt also see where he imported bootstrap

  • @ABDULLASHAIK-yp8qf
    @ABDULLASHAIK-yp8qf Жыл бұрын

    bro alignRight from drop down is not working .please help me

  • @viditkumarjain1994
    @viditkumarjain19942 жыл бұрын

    Hi try to make the same getting error when trying to add or remove to cart button

  • @user-ys1hr7iu9b
    @user-ys1hr7iu9b11 ай бұрын

    I found the error while installing the faker, anyone can help me in this? Error- Module not found: Error: Can't resolve 'faker' in 'D:\Projects\e-commerce\src\context'

  • @ronyroy3587
    @ronyroy35873 ай бұрын

    How I will create increment and decrement button . Alternative of select and option. Can you tell me. I created but not working properly

  • @artemkhasin3735
    @artemkhasin37352 жыл бұрын

    Is it possible to specify versions of all nmp's you are using, and react version as well. Every time I'm installing something it is not working the propper way. I follow the code line by line and check each character but the result is different. I actually stoped wne you installed "faker", since it is not working at all, it just says module is not found

  • @shruthichandran2796

    @shruthichandran2796

    2 жыл бұрын

    Try in react 17

  • @emonislam1660
    @emonislam16602 жыл бұрын

    Great

  • @codedude8253
    @codedude8253 Жыл бұрын

    whenever I add items to cart in Context it works fine , but when I go to Cart page the cart Context gets reset and it becomes empty.What should I do ? I thik its happening due to when I route to cart page the page gets refreshed.

  • @sanyamjain4777
    @sanyamjain47772 жыл бұрын

    Can i use api endpoint to get fake data will it work the same?

  • @siscoo5763
    @siscoo5763 Жыл бұрын

    hi guys please if someone faced this prob , when i get data from my api even if api contain data its not setting it in products state , how to fix that

  • @sarthakkanungo9790
    @sarthakkanungo9790 Жыл бұрын

    why it is throwing error in single product component ,Cannot read properties of undefined (reading 'some')

  • @muhammadsibtain4855
    @muhammadsibtain4855 Жыл бұрын

    (6:61388) autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated. How to Fix this ??

  • @SagarTakoresdt
    @SagarTakoresdt2 жыл бұрын

    40:29 Can you please explain how this destructing work while using spread operator, understand, but fill like something missing

  • @RoadsideCoder

    @RoadsideCoder

    2 жыл бұрын

    You can try to google. Will find awesome resources

  • @wayofexcellence3629
    @wayofexcellence3629 Жыл бұрын

    how can be used local storage to persist state in cart