Comments (13)
@RITESHKUMAR10 @amabirbd @yaprakbulut
I think I found my solution too.
In /components/Cart.js,
I missed adding {} around removeFromCart
Previously it was,
export default connect((state) => ({
cartItems: state.cart.cartItems,
}),
removeFromCart
)(Cart);
and I changed the above code to
export default connect((state) => ({
cartItems: state.cart.cartItems,
}),
{removeFromCart} // This is where I forgot to add the {}
)(Cart);
@amabirbd I agree with you. Looks like only if we are missing something in the connected files, we are getting this error.
PS: If you are following udemy course videos and doing exactly as the professor says then it looks like the instructor forgot to add these curly braces {} while coding.
Hope this helps
from react-shopping-cart.
@RITESHKUMAR10 @amabirbd @yaprakbulut
I think I found my solution too.
In /components/Cart.js,I missed adding {} around removeFromCart
Previously it was,
export default connect((state) => ({
cartItems: state.cart.cartItems,
}),
removeFromCart
)(Cart);and I changed the above code to
export default connect((state) => ({
cartItems: state.cart.cartItems,
}),
{removeFromCart} // This is where I forgot to add the {}
)(Cart);@amabirbd I agree with you. Looks like only if we are missing something in the connected files, we are getting this error.
PS: If you are following udemy course videos and doing exactly as the professor says then it looks like the instructor forgot to add these curly braces {} while coding.
Hope this helps
@ebbie
Thank you so much! It worked :)
from react-shopping-cart.
from react-shopping-cart.
@ebbie that's probably it.
Are you taking the udemy course?
@amabirbd Yes, I completed it yesterday and the course was really good.
from react-shopping-cart.
I am facing the same problem. @basir sir can you take a look at that issue?
from react-shopping-cart.
ok, i solved the problem.
from react-shopping-cart.
I have the same problem. How did you solve this ? @amabirbd
from react-shopping-cart.
@yaprakbulut most probably it's a typo . I forgot a "_" .
I changed
x._id !== product.id
to
x._id !== product._id
from react-shopping-cart.
@amabirbd No, this didn't solve. I checked the code but there is no wrong there. Also when my code keeps failing, I copied and pasted @basir ' s code, it still gives the same error.
from react-shopping-cart.
@amabirbd No, this didn't solve. I checked the code but there is no wrong there. Also when my code keeps failing, I copied and pasted @basir ' s code, it still gives the same error.
yes that happened to me too . check other files connected to that file like your cartReducer and store .
from react-shopping-cart.
@yaprakbulut and most importantly, don't forget to restart your pc ;)
from react-shopping-cart.
I got the same error too. Not sure how to solve it. @yaprakbulut Did you find the solution ?
@amabirbd I checked my code and there seems to be no typo
from react-shopping-cart.
@ebbie that's probably it.
Are you taking the udemy course?
from react-shopping-cart.
Related Issues (9)
- cannot read property indexof undefined in my action 0 HOT 1
- delete data from admin penal
- Bonjour Basir! Product count.
- Filter Bar Component
- Product isn't displaying!!! HOT 1
- sir product page and cart page showing same data kindly help me
- Hello Basir I have a problem with the images, they don't show on local host HOT 1
- using Api HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-shopping-cart.