Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add VNode support to VueNode due to incompatible type #406

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 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