5
Questions
1
Answers
1
Gold Badges
2
Silver Badges
2
Bronze Badges
I'm migrating my Next.js app to use React Server Components (RSC). I love the performance benefits, but I'm confused about the boundary.
Specifically: I have a ProductList RSC that fetches products, but each product card needs a client-side "Add to Cart" button with optimistic UI. What's the recommended pattern?
Sofia Greco
1
Answers14
Upvotes6700
ViewsI'm running a Node.js app inside Docker and trying to connect to a MongoDB instance running on my host machine. The connection string mongodb://localhost:27017 fails inside the container.
Error: connect ECONNREFUSED 127.0.0.1:27017
I know localhost inside Docker refers to the container itself. How do I properly connect to the host's MongoDB?
Sofia Greco
asked 2 months ago1
Answers19
Upvotes6150
ViewsI know there are plenty of articles on this, but I still can't figure out when to use type vs interface in TypeScript in practice.
Specifically I'm confused about:
&)Can someone show concrete examples of when each is clearly the better choice?
Sofia Greco
asked 3 months ago2
Answers112
Upvotes12400
ViewsI'm designing a schema for a blog platform. I have posts, comments, and users. I can't figure out when to embed vs reference:
What are the rules of thumb here?
Sofia Greco
asked 3 months ago2
Answers110
Upvotes10100
ViewsYes, I know this is a classic meme, but seriously — there are now 10 different ways to center a div and I don't know which is best in each context.
I want to understand: when to use margin: auto, Flexbox, Grid, position: absolute with transform, and the new place-items: center shorthand. What's the decision tree?
Sofia Greco
asked 6 months ago3
Answers38
Upvotes22100
Views1