Senior
A senior answer names the tradeoff, the failure, and what to measure.
How do you keep server-rendered code from shipping browser-only modules?
In a React Server Components setup, a client module and the modules it imports ship to the browser. A server component can render a client component and pass props that can be serialized. Keep document, window, and other browser APIs inside the client module. Importing that module into a server module pulls it across.
How do you design props so an illegal combination cannot be passed?
Prefer a union of variants over a set of booleans that can be true together when the product forbids that. Make the props the component needs required. The parent owns a side effect and passes a callback. A prop that means two things will be set wrong.
What fails when an effect subscribes and does not clean up?
The subscription, timer, or request outlives the unmount, and the next run adds another. Return a cleanup that removes the exact subscription that run created. Ignore a response that resolves after the cleanup, or it will apply a result to a screen that has moved on.
How do you render a long list without creating every row?
Render the rows near the viewport, plus a small overscan. That is windowing. Pagination is the simpler cut when one long scroll is not required. The scroll container needs a bounded height. Measure before adding a library.
What does marking an update as a transition change?
startTransition marks the update as interruptible. React can keep showing the previous screen while it prepares the next one, and it can drop a slow transition if a newer update arrives. Urgent input can stay responsive. It does not mean every component renders twice.
How do you test a component that loads data?
Render the loading state, the success payload, and the error, and assert the screen. Replace the boundary the component calls, not React's internals. A test that only checks that a mock was called does not show what the person using the screen sees.