That's basically hooks with memo, but provided by React by default with components being memoized based on the props. It's always a nice pattern to separate logic in HOC and presentation in the wrapped component.
Separating logic (and fetching) from rendering is something I'd certainly like to see more of in React - and just putting it in a hook isn't enough because that still has the rendering component in control of everything.
View all comments
Show parent comment
4
u/Reashu Jul 05 '26
I'm usually a big proponent of early returns, but unfortunately they don't work so well with hooks so it takes some extra care in React.