Settings

Theme

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

github.com

1 points by campbellman 2 years ago · 1 comment

Reader

campbellmanOP 2 years ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection