0

I don’t know how that happened.
Unhandled Runtime Error

SyntaxError: “undefined” is not valid JSON

import Cookies from 'js-cookie'
import { createContext, useReducer } from 'react'
export const Store = createContext()
 const initialState = {
  // cart: { cartItems: [] },
  cart: Cookies.get('cart') ? JSON.parse(Cookies.get('cart')) : { cartItems: [] },
}

kazu Asked question November 10, 2022