News for hackers. Stuff that matters.
Re:Show HN: Tired of logic in useEffect, I built a class-bas... by Weebs on Wednesday April 08, 2026 @08:57PM (#47698100)
They're modeling reactivity, not classes. It's a well established pattern in functional programming

The one time setup mixed with repeated render calls is odd, but it's a design decision they made. It reduces boiler plate, though I don't necessarily agree with it because it is a leaky abstraction

Re:Show HN: Tired of logic in useEffect, I built a class-bas... by spankalee on Wednesday April 08, 2026 @10:40PM (#47698728)
Reactivity and functional programming are orthogonal though.

And in most functional systems the one-time setup function would return the render function so the render function can close over state.

Which is pretty much what a class with fields, a constructor, and a render method give you.