From 78df8c78c4539d2408278d1a11612b6bbc47d22f Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 16 Jan 2022 15:54:58 +0800 Subject: [PATCH] fix(types/tsx): allow ref_for type on tsx elements --- packages/runtime-dom/types/jsx.d.ts | 2 ++ test-dts/defineComponent.test-d.tsx | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/runtime-dom/types/jsx.d.ts b/packages/runtime-dom/types/jsx.d.ts index e86b67fa..ab34e299 100644 --- a/packages/runtime-dom/types/jsx.d.ts +++ b/packages/runtime-dom/types/jsx.d.ts @@ -1312,6 +1312,8 @@ type ReservedProps = { | string | RuntimeCore.Ref | ((ref: Element | RuntimeCore.ComponentPublicInstance | null) => void) + ref_for?: boolean + ref_key?: string } type ElementAttrs = T & ReservedProps diff --git a/test-dts/defineComponent.test-d.tsx b/test-dts/defineComponent.test-d.tsx index 49634ef5..c47371ef 100644 --- a/test-dts/defineComponent.test-d.tsx +++ b/test-dts/defineComponent.test-d.tsx @@ -288,6 +288,7 @@ describe('with object props', () => { key={'foo'} // should allow ref ref={'foo'} + ref_for={true} /> )