r/reactjs • u/ThePutinTrumpSexTape • May 20 '26
Discussion What are some essential React programming patterns or principles that I should learn to become a lead developer?
Hi,
Had a lead developer interview last week and I got asked heavily about the SOLID principles, polymorphism and programming patterns.
I'm familiar with a lot of the concepts, but not enough to give strong answers.
What are the main programming patterns for React that I should learn so that when asked to explain a few, I can give strong, valuable answers?
Thanks
3
Upvotes
24
u/DogOfTheBone May 20 '26
Learn how keys work
I swear there's a whole class of bugs/poor code stemming from misuse of useEffect and useMemo that can be avoided with the key prop which no one seems to use outside of list mapping
26
u/Serious-Fly-8217 May 20 '26
The joy of react is that composition is all you need actually ššš
9
u/Merry-Lane May 20 '26 edited May 20 '26
Were you able to answer directly what the five principles were and their name? That should be enough in most cases.
Then itās best to have experiences with OOP heavy frameworks (like backend mostly) to give good answers.
React-wise, you can clearly say "the solid principles, polymorphism and design patterns donāt have the importance they have in C#/Java/⦠because the code produced by devs follows functional paradigm principles not OOP. Note that the SOLID principles, polymorphism and design patterns exist differently (like union types in typescript is a form of polymorphism) or should be a source of inspiration to write good code, but they arenāt that relevant in the context of react. Note that the framework itself makes us use different design patterns (like "components", hoc, providers, hooks⦠which can have different names depending on the source of the documentation about design patterns) but we rarely follow the Go4 recipes like in OOP heavy frameworks."
Ask follow up questions such as "we can discuss the design patterns react makes us use" or "we can talk about how polymorphism is a bit different with typescript" or "since we (should) avoid using classes in modern react + typescript codebases, we actually naturally follow some suggestions like "prefer composition over inheritance""⦠ofc adapt your message depending on who you have in front of you. A non-technical recruiter or a old-school OOP-only dev might not like finding himself dumbfounded, but you can have interesting conversations with well-versed devs. Maybe bounce on the cloud design patterns if you wanna brag.
Usually recruiters discuss these topics superficially if they quickly understand you know what you are talking about but are annoying if they spot a weakness. The way I see it, they are a common enough kind of interview question you should prepare, but I would only ask them as a bonus or for serious roles (like leads) because at some point it should be common knowledge (and curiosity + basics seem important qualities for leadership roles).
The principles are somewhat outdated and not relevant with react in a day-to-day basis but itās important to know them and to be able to discuss these points.
12
u/gk_instakilogram May 20 '26
Whatās unidirectional data flow? How is it applicable in a React code base?
5
u/xbojch May 20 '26
Structure in large codebases is paramount. Understanding programming patterns is beneficial, even if you won't need or apply most of them in ReactJS. Lead developer can mean many things from "only developer" to "most important developer" to "team lead" (who does little coding).
It helps if you apply the concepts on some examples to truly understand them and see their pros (and cons), then you'll be able to apply it in real code. But as many already said, too much abstraction too early can also be a bad thing.
You'll get there. Keep learning, keep building and you'll be good!
3
u/akornato May 20 '26
The interview questions you faced weren't really about specific React patterns, they were about your fundamental understanding of software architecture, which is what separates a lead from a senior developer. Anyone can list off patterns like custom hooks or render props, but a lead is expected to explain *why* they exist and connect them to timeless principles like composition, inversion of control, or single responsibility. The interviewers were probing the depth of your engineering knowledge, not just your familiarity with a specific library, because a true lead can apply these core concepts to any framework, today with React and tomorrow with whatever comes next.
Your path forward isn't to memorize a list of React patterns, but to study a core principle like dependency inversion and then find examples of how it's applied within the React ecosystem, such as through context or prop drilling. By connecting the abstract theory to your concrete, everyday code, you will build the deep, flexible understanding required to answer these questions confidently and from a place of genuine expertise. Being able to clearly articulate these deep concepts under pressure is a separate skill, which is why my team built interviews.chat to give candidates a significant advantage during those critical moments.
2
u/Dreadsin May 21 '26
Compositional jsx components are a big one Iād say. What I mean by that is, effectively using context to manage a subtree of components. You see it a lot in component libraries where they want child components to work with parent components somewhere arbitrarily high up the tree
2
u/evangelism2 May 21 '26
a potential lead is coming here to ask those questions, lol. you're cooked
2
u/bergnum May 21 '26
Everybody's too busy giving their own opinion. official collection of patterns + rules is here: https://github.com/vercel-labs/agent-skills
1
u/repeating_bears May 20 '26
SOLID is mostly an OOP thing which React code mostly isn't. I mean you can use classes but that will be a minority, and classes in JS aren't very powerful.
Even in OOP, SOLID is borderline useless. It's 90% marketing. SOLID cultists will have you believe there is some deep philosophy to it, but it's just 5 barely related principles smashed together into a catchy acronym, and one of those 5 (OCP) is absolute gibberish. You can write code that adheres to every principle that's still crap because there's way more to writing good code than those 4 things.
I've experienced a correlation between people who push SOLID and being absolutely awful programmers. Uncle Bob being the prime example. Good programmers don't think about SOLID ever - and no, not because they've internalized it because it's so damn great.
You probably dodged a bullet.
1
u/boyus May 22 '26
Component Composition
1
u/phiiiiiiii May 23 '26
This is a few pain points higher level developers usually need to solve:
- Perf: understand how to maintain and debug perf and latency - requires strong principles to maintain, hard to debug when things go wrong. Keywords: memoization, pagination, render optimization
- Polymorphism: understand how to build or leverage components down to the atomic level, making sure styling and functionality is consistent across the codebase. Keywords: atomic components, reusability, storybook
- Codebase: understand the frontend repo's set up from the root, be well-equipped to make architectural decisions. Keywords: state management, CSS frameworks
- CI/CD: understand how the repo latches onto upstream github, and understand the deployment workflow. Keywords: environment variables, deployment plan, staging/prod environments
-3
u/lostarkrocks May 20 '26
I think knowing which libraries to use is most important. There's just too many to choose from