WithBoundArgs and new {{component}} typing
#588
-
|
The migration notes recommend typing The I would've thought Footnotes |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The difference is that So if you write |
Beta Was this translation helpful? Give feedback.
WithBoundArgsis happy to accept anyComponentLiketype as input, and its behavior should be essentially identical whether you give ittypeof SomeBannerorComponentLike<SomeBannerSignature>.The difference is that
typeof SomeBannerpromises much more than just theComponentLikebit of its type—that type includes every other piece ofSomeBanner's type, including things like private fields, its inheritance hierarchy, etc.So if you write
typeof SomeBannerin your signature, you're including all of those extra bits as part of your public interface. And that's fine if the actualSomeBannervalue is what you're passing to fulfill that type. As the migration doc you linked points out, though, …