Skip to content

WithBoundArgs and new {{component}} typing #588

Answered by dfreeman
nwhittaker asked this question in Q&A
Discussion options

You must be logged in to vote

WithBoundArgs is happy to accept any ComponentLike type as input, and its behavior should be essentially identical whether you give it typeof SomeBanner or ComponentLike<SomeBannerSignature>.

The difference is that typeof SomeBanner promises much more than just the ComponentLike bit of its type—that type includes every other piece of SomeBanner'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 actual SomeBanner value is what you're passing to fulfill that type. As the migration doc you linked points out, though, …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nwhittaker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants