News for hackers. Stuff that matters.
Re:A Visual Guide to UseEffect by CottonMcKnight on Monday December 26, 2022 @08:01PM (#34143721)
Speaking of badly-named hooks, this tweet infuriated me.

If it's legal, the linter should allow it. F$@k "consistency."

https://twitter.com/acdlite/status/1581401077915975680

Re:A Visual Guide to UseEffect by AgentME on Monday December 26, 2022 @09:26PM (#34144326)
I've run into places where it would be handy to conditionally use hooks, but never the useContext hook, so I can't imagine feeling strongly about that case.
Re:A Visual Guide to UseEffect by lmm on Tuesday December 27, 2022 @01:33AM (#34145836)
Define "legal". Calling glibc memcpy with overlapping arrays worked right up until it didn't. The general contract of react hooks is that they may break in unexpected ways if you call them conditionally. The current implementation of useContext happens to not break.