
NextJS Codebase Analysis(3) - how's server props and static props work?
As we all know, Server Components are not allowed to use hooks like useState and useEffect —but why ? 🚧 Understanding the Request Flow Let’s start from a typical page request. When a request comes in (and possibly hits the cache), it flows through several key functions: handleResponse doRender renderToHTMLOrFlightImpl generateCacheEntry 👉 generateCacheEntry is the core of Next.js caching strategy. 🔑 Key Parameters in generateCacheEntry From the function signature, we can identify some critical parameters: encodeCacheKeyParts fn (the actual render function) 🧩 Cache Keys and Server References Taking a deeper look at encodeCacheKeyParts , we notice something important: It generates keys that match those in server-reference-manifest.json . This connects directly to concepts discussed in the previous article. Each page/component has a corresponding cache key These keys are heavily used across Next.js internals ⚙️ The Core Execution: generateCacheEntryImpl Continuing down the call stack, we
Continue reading on Dev.to React
Opens in a new tab



