diff --git a/types/test/v3/define-component-test.tsx b/types/test/v3/define-component-test.tsx
index 9b01e3e45f4..1b0847a3795 100644
--- a/types/test/v3/define-component-test.tsx
+++ b/types/test/v3/define-component-test.tsx
@@ -1079,3 +1079,39 @@ export default {
}
})
}
+
+describe('functional w/ array props', () => {
+ const Foo = defineComponent({
+ functional: true,
+ props: ['foo'],
+ render(h, ctx) {
+ ctx.props.foo
+ // @ts-expect-error
+ ctx.props.bar
+ }
+ })
+
+ ;
+ // @ts-expect-error
+ ;
+})
+
+describe('functional w/ object props', () => {
+ const Foo = defineComponent({
+ functional: true,
+ props: {
+ foo: String
+ },
+ render(h, ctx) {
+ ctx.props.foo
+ // @ts-expect-error
+ ctx.props.bar
+ }
+ })
+
+ ;
+ // @ts-expect-error
+ ;
+ // @ts-expect-error
+ ;
+})
diff --git a/types/v3-define-component.d.ts b/types/v3-define-component.d.ts
index f2d3ab1684c..30f7046e403 100644
--- a/types/v3-define-component.d.ts
+++ b/types/v3-define-component.d.ts
@@ -18,6 +18,7 @@ import {
} from './v3-component-public-instance'
import { Data, HasDefined } from './common'
import { EmitsOptions } from './v3-setup-context'
+import { CreateElement, RenderContext } from './umd'
type DefineComponent<
PropsOrPropOptions = {},
@@ -66,6 +67,30 @@ type DefineComponent<
props: PropsOrPropOptions
}
+/**
+ * overload 0.0: functional component with array props
+ */
+export function defineComponent<
+ PropNames extends string,
+ Props = Readonly<{ [key in PropNames]?: any }>
+>(options: {
+ functional: true
+ props?: PropNames[]
+ render?: (h: CreateElement, context: RenderContext) => any
+}): DefineComponent
+
+/**
+ * overload 0.1: functional component with object props
+ */
+export function defineComponent<
+ PropsOptions extends ComponentPropsOptions = ComponentPropsOptions,
+ Props = ExtractPropTypes
+>(options: {
+ functional: true
+ props?: PropsOptions
+ render?: (h: CreateElement, context: RenderContext) => any
+}): DefineComponent
+
/**
* overload 1: object format with no props
*/