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.
WithBoundArgs
is happy to accept anyComponentLike
type as input, and its behavior should be essentially identical whether you give ittypeof SomeBanner
orComponentLike<SomeBannerSignature>
.The difference is that
typeof SomeBanner
promises much more than just theComponentLike
bit 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 SomeBanner
in your signature, you're including all of those extra bits as part of your public interface. And that's fine if the actualSomeBanner
value is what you're passing to fulfill that type. As the migration doc you linked points out, though, …