This might only make sense for react specific stuff, but if we have a user defined type for the params Foo, then we want to to ensure that we unpack all the params, otherwise there can be unused args to the component.
type FooParams = {
a: string
b: string
c: string
}
// error since we didn't unpack `c`
function Foo({ a, b }: FooParams) {}
// ok
function Foo({ a, b, ...rest}: FooParams) {}
// ok
function Foo({ a, b, c}: FooParams) {}
This might only make sense for react specific stuff, but if we have a user defined type for the params
Foo
, then we want to to ensure that we unpack all the params, otherwise there can be unused args to the component.