I have products card with button "add to basket" and a cart component than display the number of added products.
Added products stored in localsorage.
I want that when a button "add to basket" is clicked, the number in the cart component will increase.
The only option that comes to my mind is to wrap the entire application in React Context, but in this case I will have to do everything as a “use client”, I would like to avoid this.
Not necessarily, because the client component can accept the server component as a prop. reference. So even though you want to use global state or you want to use context - you can go ahead following this pattern