usehooks
usehooks copied to clipboard
Fix useObjectState type
The example provided doesn't work. The setter can take either the object or a function but the type only allows the object.
setStats((s) => ({
wins: s.wins + 1,
}));