Skip to content
Discussion options

You must be logged in to vote

Since the Template is typed as ComponentStory<typeof Accordion>, Sizes.args is typed as AccordionProps, not AccordionHeaderProps. The type of the function parameter (args) isn't affecting that type inference.

If you do this, it fixes the error:

const Template: ComponentStory<typeof AccordionHeader> = (
  args: AccordionHeaderProps
) => (
  <Accordion>
    <AccordionItem value="1">
      <AccordionHeader {...args}>Accordion Header 1</AccordionHeader>
      <AccordionPanel>
        <div>Accordion Panel 1</div>
      </AccordionPanel>
    </AccordionItem>
  </Accordion>
);

export const Sizes = Template.bind({});
Sizes.args = { size: "small" };

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by khmakoto
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