Skip to content

Commit 5aed733

Browse files
committed
test: add test case for #12778
1 parent f7db7f3 commit 5aed733

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Diff for: types/test/v3/tsx-test.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VNode, defineComponent, ref } from '../../index'
1+
import { VNode, defineComponent, ref, RenderContext } from '../../index'
22
import { expectType } from '../utils'
33

44
expectType<VNode>(<div />)
@@ -25,7 +25,13 @@ expectType<JSX.Element>(<div ref="bar" />)
2525
// allow Ref type type on arbitrary element
2626
const fooRef = ref<HTMLElement>()
2727
expectType<JSX.Element>(<div ref={fooRef} />)
28-
expectType<JSX.Element>(<div ref={(el) => {fooRef.value = el as HTMLElement}} />)
28+
expectType<JSX.Element>(
29+
<div
30+
ref={el => {
31+
fooRef.value = el as HTMLElement
32+
}}
33+
/>
34+
)
2935

3036
expectType<JSX.Element>(
3137
<input
@@ -56,5 +62,8 @@ const Foo = defineComponent({
5662
// working
5763
;<Foo bar={1} />
5864
;<Foo bar={1} foo="baz" />
59-
6065
;<div slot="x" />
66+
67+
export default ({ data }: RenderContext) => {
68+
return <button {...data} />
69+
}

0 commit comments

Comments
 (0)