类型“IntrinsicAttributes & DeliveryInfoProps”上不存在属性“href”

时间:2021-06-16 11:05:46

标签: typescript next.js storybook

我在模板中有 2 个组件,它们接收 {...args} 但在一个组件中我有什么 href 而另一个我不想有 href 所以在一个组件中是链接在另一个是文本

当我放入另一个组件 <DeliveryInfoComponent {...args} href="textLink" /> 时,rooro 向我显示属性“href”不存在于类型“IntrinsicAttributes & DeliveryInfoProps” 但 {{1 }} 位于 href 的界面中。

.故事

bottomTextProps

.tsx

const Template: StoryType<DeliveryInfoProps> = (args) => (
  <>
    <DeliveryInfoComponent {...args} />
    <DeliveryInfoComponent {...args} href="textLink" />
  </>
);

export const DeliveryInfo = Template.bind({});

DeliveryInfo.args = {
  heading: 'heading4',
  body: 'body',
  bodyHeading: 'heading4',
  icon: <PostnlIcon />,
  bottomTextProps: {
    title: 'title',
    href: 'text',
  },
};

0 个答案:

没有答案