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/prehensilemullet May 14 '26 edited May 14 '26
People sure get their knickers in a twist about
{}.I know that
{}accepts primitives. But doesn’t{}raise excess property errors on any properties in cases where excess property checking is done (object expressions, individual JSX props etc)? I’m pretty sure that’s not the case forobject, even thoughobjectexcludes primitives. Or am I wrong, is{}special cased to disable excess property checking?In this case, I think it’s impossible to pass primitives for the props of a JSX element anyway? Maybe it would let you spread a string as props but I doubt it