Skip to content

Commit

Permalink
fix(defineComponent): 组件的内部属性去除 key 和 ref
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Jul 20, 2020
1 parent ceecb28 commit 57196ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/react/defineComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ export type DefineComponentOptions<
* 组件。
*/
component: TForwardRef extends true
? React.ForwardRefRenderFunction<TRef, RequiredBy<TProps, keyof TProps>>
: React.FC<RequiredBy<TProps, keyof TProps>>
? React.ForwardRefRenderFunction<
TRef,
Omit<RequiredBy<TProps, keyof TProps>, 'key' | 'ref'>
>
: React.FC<Omit<RequiredBy<TProps, keyof TProps>, 'key' | 'ref'>>
}

/**
Expand Down

0 comments on commit 57196ff

Please sign in to comment.