Browse Source

fix(types/tsx): allow ref_for type on tsx elements

Evan You 4 years ago
parent
commit
78df8c78c4
2 changed files with 3 additions and 0 deletions
  1. 2 0
      packages/runtime-dom/types/jsx.d.ts
  2. 1 0
      test-dts/defineComponent.test-d.tsx

+ 2 - 0
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> = T & ReservedProps

+ 1 - 0
test-dts/defineComponent.test-d.tsx

@@ -288,6 +288,7 @@ describe('with object props', () => {
       key={'foo'}
       // should allow ref
       ref={'foo'}
+      ref_for={true}
     />
   )