diff --git a/react-context-api/src/components/cart-dropdown/cart-dropdown.component.jsx b/react-context-api/src/components/cart-dropdown/cart-dropdown.component.jsx index 717726cf7..449462025 100644 --- a/react-context-api/src/components/cart-dropdown/cart-dropdown.component.jsx +++ b/react-context-api/src/components/cart-dropdown/cart-dropdown.component.jsx @@ -1,5 +1,4 @@ import React from "react"; -import { withRouter } from "react-router-dom"; import CustomButton from "../custom-button/custom-button.component"; import CartItem from "../cart-item/cart-item.component"; @@ -28,4 +27,4 @@ const CartDropdown = ({ cartItems, history, toggleCartHidden }) => ( ); -export default withRouter(CartDropdown); +export default CartDropdown; diff --git a/react-context-api/src/containers/CartDropdownContainer/CartDropdownContainer.js b/react-context-api/src/containers/CartDropdownContainer/CartDropdownContainer.js index d827c5453..44bd2f00f 100644 --- a/react-context-api/src/containers/CartDropdownContainer/CartDropdownContainer.js +++ b/react-context-api/src/containers/CartDropdownContainer/CartDropdownContainer.js @@ -1,4 +1,5 @@ import React from "react"; +import { withRouter } from "react-router-dom"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; @@ -7,9 +8,10 @@ import { toggleCartHidden } from "../../redux/cart/cart.actions.js"; import CartDropdownComponent from "../../components/cart-dropdown/cart-dropdown.component"; -const CartDropdownContainer = ({ cartItems, toggleCartHidden }) => ( +const CartDropdownContainer = ({ cartItems, history, toggleCartHidden }) => ( ); @@ -22,7 +24,9 @@ const mapDispatchToProps = dispatch => ({ toggleCartHidden: () => dispatch(toggleCartHidden()) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(CartDropdownContainer); +export default withRouter( + connect( + mapStateToProps, + mapDispatchToProps + )(CartDropdownContainer) +);