0

Hi i am learning react with redux and i don't know how to put table inside items.

redux dev tools picture

This is my reducer:

  case FETCH_CART_PRODUCTS:
  return {
    ...state ,
    items: action.payload
  }
  case PURCHASE:
  return {
    ...state,
    orders: action.payload
  };
  case FETCH_ORDERS:
  return {
    ...state,
    orders: action.payload
  }
  case TABLE_NUMBER:
  return {
    ...state,
    table: action.payload
  }
default:
  return state;

} }

Thank you for answers!

1 Answers1

0

State is always accessible via store.getState() function.

check below answer for more info.

How do I access store state in React Redux?

  • In particular, you want to focus on the connect HOC in the guide above to connect your component to the state with mapStateToProps – Chimera.Zen Mar 19 '19 at 20:47