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

Missing FunctionalComponent props are no longer reported in the template #2676

Closed
sqal opened this issue Apr 22, 2023 · 1 comment
Closed
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@sqal
Copy link

sqal commented Apr 22, 2023

Version

Volar: >= 1.4.0
Vue: 3.2.47
TypeScript: 5.0.4

tsconfig:

{
  "compilerOptions": {
    "module": "ESNext",
    "target": "ESNext",
    "lib": ["ESNext", "DOM", "DOM.Iterable"],
    "skipLibCheck": true,
    "jsx": "preserve",

    "strict": true,
    "noImplicitReturns": true,
    "noImplicitAny": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,

    "moduleResolution": "bundler",
    "isolatedModules": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "verbatimModuleSyntax": true
  },
  "include": [
    "./src/**/*.ts",
    "./src/**/*.vue"
  ]
}

Steps to reproduce

<script setup lang="ts">
  import { h, type FunctionalComponent } from 'vue';

  const Icon: FunctionalComponent<{ name: string }> = (props) => (
    h('svg', [
      h('use', {
        'xlink:href': `#${props.name}`,
      }),
    ])
  );
</script>

<template>
  <Icon />
</template>

What is actually happening?

TypeScript doesn't warn me that <Icon /> is missing a prop name.

What is expected?

Error about missing prop reported.

Screenshot

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Apr 22, 2023
@johnsoncodehk
Copy link
Member

Fixed by e5e2349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

2 participants