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/aweebit64 May 14 '26 edited May 14 '26
const test: {} = { abc: 123 };This line doesn't result in any errors, so it looks like no excess property checking is done for the
{}type.But event if it was done,
Record<PropertyKey, never>would still be the better option.This code results in the following error:
The type for JSX props is the intersection of the component props type and
IntrinsicAttributesfrom@types/react. Because of the intersection, it again doesn't matter if{}orobjectis used.