In your e-commerce application, a class component named AddToCartButton is present. Choose the correct implementation of the below given buttons that, when clicked, triggers a method named addToCart and logs "Item added to cart!" to the console.
import React, { Component } from "react";
class AddToCartButton extends Component {
addToCart = () => {
console.log("Item added to cart!");
};
render() {
return ...
}
}
export default AddToCartButton;