Git Product home page Git Product logo

Comments (13)

ebbie avatar ebbie commented on August 18, 2024 3

@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.

yaprakbulut avatar yaprakbulut commented on August 18, 2024 2

@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.

RITESHKUMAR10 avatar RITESHKUMAR10 commented on August 18, 2024 1

from react-shopping-cart.

ebbie avatar ebbie commented on August 18, 2024 1

@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.

amabirbd avatar amabirbd commented on August 18, 2024

I am facing the same problem. @basir sir can you take a look at that issue?

from react-shopping-cart.

amabirbd avatar amabirbd commented on August 18, 2024

ok, i solved the problem.

from react-shopping-cart.

yaprakbulut avatar yaprakbulut commented on August 18, 2024

I have the same problem. How did you solve this ? @amabirbd

from react-shopping-cart.

amabirbd avatar amabirbd commented on August 18, 2024

@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.

yaprakbulut avatar yaprakbulut commented on August 18, 2024

@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 avatar amabirbd commented on August 18, 2024

@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.

amabirbd avatar amabirbd commented on August 18, 2024

@yaprakbulut and most importantly, don't forget to restart your pc ;)

from react-shopping-cart.

ebbie avatar ebbie commented on August 18, 2024

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.

amabirbd avatar amabirbd commented on August 18, 2024

@ebbie that's probably it.
Are you taking the udemy course?

from react-shopping-cart.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.