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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Enabling custom "god" react hooks that don't trigger unexpected re-renders

1 点作者 campbellman超过 1 年前

1 comment

campbellman超过 1 年前
I was working on an app that had a ton of app logic within a single custom react hook. The hook's return value was passed to a context provider, which was a re-render nightmare. The code was hard to optimize without breaking the logic up into many smaller contexts. Rather than doing that, I wrote this library instead so that the hook's return values were accessible in "re-render safe" ways. It's a WIP, so feedback is welcome :)