News for hackers. Stuff that matters.
Re:Solid.js feels like what I always wanted React to be by Scarblac on Tuesday March 01, 2022 @02:21AM (#30510745)
When you have multiple hooks in a component it usually makes sense to put them in a function with a good name - a custom hook. It's easy and almost always usually gives simple code.
Re:Solid.js feels like what I always wanted React to be by bryanrasmussen on Tuesday March 01, 2022 @03:06AM (#30511068)
sure, and sometimes it still would be simpler with the older lifecycle methods. Not saying it is always the case but for some reason it is assumed it could never be the case.
Re:Solid.js feels like what I always wanted React to be by dnsco on Tuesday March 01, 2022 @02:28AM (#30510800)
a benefit of custom hooks is that you can test complex state logic isolated from the view