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 RU-vid bhai 😍❤️
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
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.
@@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]), }));
Module not found: Error: Can't resolve 'faker' in 'C:\shop cart\shopping-app\src\context i got this error even after i install faker i dont know what to do . please help me
Its wonderful project but I am not able to fetch only images data. Can u anyone pls suggest how can i get images,. I got all other data. pls suggest is someone had same issue
When i done project i have a doubt here it is showing "faker" can't resolve,i done installation of faker then too its showng this error also my file name is correct..
guy can you please help me out this. i've done everything but image is not showing. i've done everything but still the images is not showing. please help
In this I'm first spreading the state so that we take everything that's inside of the state, then in cart variable we are taking everything inside of cart by spreading it and then adding a new product.
I installed the same version of faker but when the random.datatype with uuid and boolean are not read and are causing an error i get this error on the console
@@RoadsideCoder Yea it returned data when I remove id and fastDelivery keywords but I managed to create a unique id with the Math.random().toString method but I am stuck in the fastDelivery with the boolean datatype.
index.js:11 Uncaught TypeError: react_dom_client__WEBPACK_IMPORTED_MODULE_1__.render is not a function at ./src/index.js (index.js:11:1) at options.factory (react refresh:6:1) at __webpack_require__ (bootstrap:24:1) at startup:7:1 at startup:7:1 how to solve ??
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.
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.
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'
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?
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?
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.
faker is not working for me , it's continuously showing me error that module not found , even I've installed it properly again and again ? can anyone helps me out of it?
"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
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
Module not found: Error: Cannot find file: 'index.js' does not match the corresponding name on disk: './node_modules/faker/Faker'. why i am getting this error can anyone help
Dude there's something wrong within reducer.js , I have copied the code as it is but once I deselect one item all items are automatically removed from cart. Is there anything that is not shown in video ?
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?
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!