Skip to content

Instantly share code, notes, and snippets.

@bartocc
Last active September 8, 2023 08:19
Show Gist options
  • Save bartocc/297928c5bcc127d903c1285356a8413a to your computer and use it in GitHub Desktop.
Save bartocc/297928c5bcc127d903c1285356a8413a to your computer and use it in GitHub Desktop.
Component block argument signature not available in consuming app
import Component from '@glimmer/component';
import { hash } from '@ember/helper';
import { Input } from '@ember/component';
import { WithBoundArgs } from '@glint/template';
/*****************************
ConsumingComponent
*****************************/
class ConsumingComponent extends Component {
<template>
<FooComponent as |f|>
{{!-- No error here --}}
<f.Input />
</FooComponent>
</template>
}
/*****************************
FooComponent
*****************************/
interface FooSignature {
Blocks: {default: [{Input: WithBoundArgs<typeof Input, 'type'>}]};
}
export default class FooComponent extends Component<FooSignature> {
<template>
{{yield (hash Input=(component Input type="dummy"))}}
</template>
}
<FooComponent as |f|>
{{!--
This expression is not callable.
Type 'never' has no call signatures.
--}}
<f.Input />
</FooComponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment