How would you implement a shopping-cart with app dir?
Answered
simpros posted this in #help-forum
simprosOP
I was thinking about using cookies 🤔 I have a button in the top menu that should have a badge showing the current number of articles in it. Would that work with cookies?
Answered by alfon
that was fast, yeah you can put server component inside children component and its going to be slotted after client component finished rendering
14 Replies
simprosOP
the cookie would be set with server actions triggered on a button press
I was also thinking about making it all client side to use some state/context but that would require some kind of provider which is only available on client side but I don't want to make the whole application client side 🤔
simprosOP
bump
using provider properly wont make the whole application client side
simprosOP
but to use provider i have to "use client" and underneath it i cannot have a server component if I am right 🤔
@simpros but to use provider i have to "use client" and underneath it i cannot have a server component if I am right 🤔
nope, try reading "react essential" section on Next.js docs
simprosOP
i think i got the idea now, thank you very much ðŸ‘
i am just to dumb to read... maybe I should switch jobs
that was fast, yeah you can put server component inside children component and its going to be slotted after client component finished rendering
Answer
but you read fast 🙃
simprosOP
I get the concepts fast I guess 😄
maybe you should stay since more and more tech come up every week 

simprosOP
Coming from sveltekit next is much more different then i first thought 😄