Question presented to candidate: "Beyond the API, what principles has the React team said guide its design — and where can you see them in the library you use every day?"
What a strong answer should cover:
- Composition — the headline principle. Components by different authors must work together, and you must be able to add functionality without rippling changes.
- Common abstraction — React resists adding features that can be built in userland; a feature has to earn its place in the core.
- Escape hatches — React is pragmatic.
useRef,useEffect,flushSync, portals, anddangerouslySetInnerHTMLall exist to let you step outside the declarative model. - Stability — gradual migration paths, deprecation warnings before removal, and codemods rather than hard breaks.
- Interoperability — it must wrap non-React code and be wrappable by it.
- Scheduling — React controls when work happens, which is precisely what made concurrent rendering possible later.
- Optimised for tooling — explicit, statically analysable APIs so linters, compilers, and devtools can reason about your code.
- Developer experience and debugging — component stacks, warnings, and DevTools are treated as first-class.
- The strongest version connects each principle to something concrete: Hooks rules exist for tooling;
keyexists for scheduling;childrenexists for composition.
Clarifying questions expected:
- "Do you want the documented principles, or my read on the trade-offs they imply?"
Code / implementation expected: No. This is a discussion question; concrete examples of each principle matter more than code.