Hacker News new | ask | show | jobs
Enabling custom "god" react hooks that don't trigger unexpected re-renders (github.com)
1 points by campbellman 969 days ago
1 comments

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 :)