HandbookII the ForumServer and client rendering
IIthe Forum, The shape of an appServer and client rendering
In plain words
Server rendering builds a page's HTML on the server before sending it, while client rendering sends an empty shell and builds the page in the browser with JavaScript.
Where you see it
Right-click your Lovable app and choose View Page Source: the page is almost empty apart from one <div id="root">, because React builds everything in the browser. Do the same on a Next.js site and the page's text is already there.
What goes wrong
- useState in a Server Component
Next.js stops with an error saying the hook only works in a Client Component. Add "use client" to the small interactive piece, not to the whole page.
- Link previews that all look the same
Slack, WhatsApp and LinkedIn read the first HTML without running JavaScript. In a browser-built app every page shares the same shell, so every link gets the same generic preview.
- Hydration errors
React expects the browser's first draw to match the server's HTML exactly. A date or random number that differs between the two triggers "Hydration failed" in the console.
What to tell your agent
Quick check
Sign in to earn +10 XP for itEvery Quill note you share in Slack gets the same generic preview. Quill is a Lovable app. What's behind it?