Skip to content

Conversation

@ProgrammingWithSid
Copy link
Contributor

Added VNode to the VueNode type definition to include virtual nodes returned by the h() function. This change addresses warnings related to bannerTitle and bannerIcon in the component. By including VNode in the type, we improve type safety and ensure proper rendering of icons when they are conditionally displayed.

const bannerTitle = props.title
  ? h(
    Text,
    { variant: 'headingSm', as: 'h2', breakWord: true },
    () => props.title,
  )
  : undefined;

const bannerIcon = !props.hideIcon
  ? h(
    'span',
    { class: styles[bannerColors.value.icon] },
    h(Icon, { source: props.icon || bannerAttributes[bannerTone.value].icon, }),
  )
  : undefined;

…Icon and bannerTitle because of incompabible type
@juzser juzser requested review from HQCuong and blacklen October 7, 2024 07:38
@juzser juzser added the feat: types All tweaks relate to typescript label Oct 7, 2024
@juzser juzser merged commit a4a1ad6 into ownego:master Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: types All tweaks relate to typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants