I utilize context in Qwik in the following manner.
import {
component$,
Slot,
useContextProvider,
useStore,
} from '@builder.io/qwik'
import { AppContext } from 'Base'
const AppContextProvider = component$(() => {
const app = useStore({
Qwik: "Qwik context is ready to use",
})
useContextProvider(AppContext, [app])
return (
<>
<Slot />
</>
)
})
export default AppContextProvider
I utilize it within my components.
const [app] = useContext(AppContext)
then I can change or add new item in store in components like this
app.compareItemsId=[1,2,3,4]
When I try to access this value in other components, its data type shows as "proxy".
Proxy(Array)
how can I fix this problem
log from context
I'm not seeing the "proxy" output in the following example:
Here's the output in the server window: