Closed 2sdarko closed 2 years ago
TypeError: Cannot read properties of undefined (reading '_id') (anonymous function) src/screens/PlaceOrderScreen.js:31 28 | 29 | useEffect(() => { 30 | if (success) {
31 | history.push(
/order/${order._id}
) | ^ 32 | dispatch({ type: ORDER_CREATE_RESET }) 33 | } 34 | },[success, history]) View compiled ▶ 22 stack frames were collapsed. (anonymous function) src/actions/orderActions.js:42 39 | payload: data 40 | }) 41 | 42 | dispatch({ | ^ 43 | type: CART_CLEAR_ITEMS, 44 | payload: data 45 | })
I'm stuck at section 52, in PlaceOrderScreen. Keep getting ff error:
TypeError: Cannot read properties of undefined (reading '_id'), from this segment:
========================== useEffect(() => { if (success) { history.push(
/order/${order._id}
) dispatch({ type: ORDER_CREATE_RESET }) } },[success, history])Please help