r/reactjs • u/Darsh___01 • Jun 05 '26
Discussion What’s one React concept that finally clicked for you after struggling with it?
For me, some concepts seemed simple at first but made much more sense once I started building real projects.
Curious to know — what React concept took you the longest to understand, and what helped it finally click?
61
Upvotes
89
u/Hefty_Breadfruit Jun 05 '26
This video from the most recent react conference about react compiler ironically helped me really understand useMemo, which is funny because it’s about why it’s no longer needed
77
u/Str00pwafel Jun 05 '26
There is almost always a way to not use useEffect
56
u/azsqueeze Jun 05 '26
I think the idea of composition via JSX is lost on many people and once it "clicks" react because super easy and elegant
15
u/Lonestar93 Jun 05 '26
Lazy component evaluation. Your component body is not run when you write <MyComponent />, it just creates a tiny object describing the function to call, the props to pass, the key, and the children.
That’s why you can also bind <MyComponent /> to a const and use it in multiple places in the same component, it’ll just get evaluated independently in each place.
It’s also why a children-receiving component conditionally returning null can actually skip the work of the children, even if it seems like those children must have already been evaluated to be passed in in the first place!
55
u/J_revolution Jun 05 '26
useMemo and useCallback are underrated, useEffect is overrated.
7
u/jo_sh_o Jun 06 '26
Composition over inheritance… Oh man
6
u/MassiveInstance4724 Jun 05 '26
Hooks under the hood
23
u/Storm_Surge Jun 05 '26
I feel like knowing when to reach for useEffect and understanding how it works is crucial. I would likely ask about this when interviewing candidates. They should know about how you can return a cleanup function from useEffect as well
4
u/pconrad0 Jun 06 '26
I'm still waiting for any of it to click, if I'm honest.
When something works, I'm grateful.
3
u/mike-pete Jun 06 '26
Not react specific, but promises took forever to click
3
u/Ophie Jun 06 '26
Curious to know what these AI slop threads are harvesting. There’s an epidemic of curiosity on programmer related subreddits these days.
3
u/everdimension Jun 06 '26
While I can't say I struggled with it, the "don't store state when you can derive it" still feels like it "clicks" every now and then. It's such a liberating feeling when you're designing some complex stateful UI and realize that parts of aren't really state and this immediately simplifies everything
2
u/roshaan20043 Jun 06 '26
Generally in front end development, recently I realized a really basic thing, there are only really a few limited things that trigger a state change:
Outside of these, the app just sits idle. Everything else is just describing what the UI should look like when one of them fires. This idea helped me structure apps around states and computed values much more cleanly.
To be fair I mostly worked on Angular class based and we didn't have to explicitly define state there.
1
u/godemperorTf Jun 07 '26
followed
1
u/cr6d Jun 07 '26
custom hooks and refs 😇
1
u/Paw565 Jun 10 '26
Prefetching tanstack queries on the server in next.js.
1
u/Plenty-Act2789 Jun 06 '26
Bro just useVue
-3
u/Far-Stranger-270 Jun 05 '26
Yes. Finally understanding that React is now basically Windows XP. People use it because people use it. There are now literally dozens of other well supported an stable front end libraries and frameworks that have been built to specially do everything better than react does. Understanding this concept really helped me to stop using it and do better faster.
-2
u/Long-Fact-6354 Jun 06 '26
we're still writing react? I thought AI does it now
-3
u/Darsh___01 Jun 05 '26
Approve!