News for hackers. Stuff that matters.
Re:React Still Feels Insane and No One Is Talking About It by mehagar on Wednesday July 02, 2025 @01:05PM (#44446144)
More likely they don't even need to use useMemo if it's not an expensive calculation. They can just calculate the dependent values during rendering, which is explained in the docs: https://react.dev/learn/you-might-not-need-an-effect#updatin...

If `getLinkedCats` calls an external API, then the calculation can instead be all in the same useEffect.

The number one mistake I see people inexperienced with React doing is using too many useEffect's in their code, which is both hard to read and hurts performance, since it results in more renders than necessary.

Re:React Still Feels Insane and No One Is Talking About It by olkingcole on Wednesday July 02, 2025 @05:08PM (#44448853)
I'll point out that just on this comment string from telmac are 3 different interpretations of what is wrong with the code and what should be done instead.