#React context doesn't work anymore since I migrated my project with TypeScript

17 messages ยท Page 1 of 1 (latest)

wet nova
#

Do you get any kind of errors?

strange surge
#

No I have nothing in my console, it's really disturbing

wet nova
#

OK I'll look into it.

#

Your dependency versions are messed up btw.

#

@strange surge Somehow your cartContext is undefined as you're using it on the product page.

#

I'm not yet sure how that's possible, any ideas?

#

@strange surge Oh wait I can see you're creating a new CartContext in ProductPage.tsx instead of importing it from App.tsx

#

If you can I'd recommend using Vite instead of CRA btw.

strange surge
wet nova
#

Anyway I'd also recommend you get familiar with the debugger tools in the browser.

strange surge
#

It work perfectly well now, thank you so much ๐Ÿ˜ƒ

wet nova
#

Yw

strange surge
eager axle
wet nova
eager axle