-2
    TypeError: getState is not a function

  32 | 
  33 | export const removeFromCart = (product) => (dispatch, getState) => {
> 34 |      getState() 
  35 |     const cartItems = getState().cart.cartItems.slice().filter(
  36 |         (x) => x._id !== product._id
  37 |         );`enter code here`
View compiled
▶ 29 stack frames wer
4

1 回答 1

0

您需要将 getState 分配给这样的 var:

const state = getState() ;
于 2021-05-08T17:57:41.447 回答