Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It’s much easier to create a list of dependencies a la second argument to useEffect.

Even easier to just not do that, either, as in Solid’s version of hooks.



Honest question, is what you’re referring to this[1] or something else? I’d be interested to see how hooks could work without side effects.

[1] https://github.com/ryansolid/component-register-hooks


> Honest question, is what you’re referring to this[1] or something else?

I’m talking about Solid, the web framework, which has hooks (they call them “effects”) similar to those in React, but which do not require explicit dependency lists when specifying them.

https://www.solidjs.com/tutorial/introduction_effects


Thanks. I don't understand how it's better though, wouldn't you need to start following the Rules of Hooks for this data retrieval (`count()`) as well, lest the renderer not know what all your dependencies are?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: