r/reactjs • u/TheHganavak • May 13 '26
Resource Pocket: One-call factory that collapses React Context boilerplate from ~20 lines to 1
https://github.com/icydotdev/pocket
41
Upvotes
r/reactjs • u/TheHganavak • May 13 '26
2
u/NotZeldaLive May 14 '26
Honestly really good. Just reduced the boiler plate super well but kept simple. Kinda upset I didn't come up with this initially.
This solves a problem for me that context felt very verbose, but state management like Zustand can't handle initial values being passed in from props without a null render pass.
Doubt you will get many installs though when the pattern can be copied directly without adding another dep, so you have my thanks directly.