Re:Two custom React hooks
by ajkjk on Friday December 17, 2021 @12:23PM
(#29595231)
I love hooks. Just saying. They're so much better than what came before.
[ Parent
| on HN ]
Re:Two custom React hooks
by worldsayshi on Friday December 17, 2021 @12:43PM
(#29595524)
I also really like them but I fear that they are a bit magical, i.e. they solve a problem in a way that feels very simple but might end up blowing up in complexity once you look at them from a certain angle. Like when debugging certain state issues. They are very nice until they break in unexpected ways.
I feel that React is like.. 20% of the way to programming nirvana, and hooks are like 24% of the way, but it's very much just another step on the path. They're an inelegant expression of an elegant idea, which class components couldn't express at all.
Re:Two custom React hooks
by worldsayshi on Monday December 20, 2021 @08:05PM
(#29632578)
I haven't really tried it but I would expect that Elm has solved at least some of those problems already. It feels like hooks are (another?) attempt at making react more monad-like but without having the type system to back it up.