TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

UseEvent RFC: Hook for event handlers with an always-stable function identity

7 点作者 tomduncalf大约 3 年前

3 条评论

Cthulhu_大约 3 年前
I am... more and more disliking React for making me have to think about performance as much. I don't want to have to wrap click handlers in useCallback() or useEvent(). I don't want to have to wrap components in react.Memo. It feels like that's a lot of extra boilerplate and mental overhead that I think the framework should manage for me.
评论 #31385412 未加载
jwalton大约 3 年前
Nice idea. Terrible name. I can think of many places I’d use this that have nothing to do with events.
tomduncalf大约 3 年前
I’ve not thought too deeply about how this will work in practice, but seems like a good step towards solving the confusing situation with the useEffect dependency array needing to contain things that you don’t actually want to the effect to re-run for (which I think could perhaps have been designed better up front, I find it pretty confusing to deal with and I’ve been doing React for over 8 years…)