Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
feat: PropsTypeFromFC
Browse files Browse the repository at this point in the history
  • Loading branch information
dotennin committed Aug 1, 2020
1 parent 6ba949b commit 6c3885d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/types/index.d.ts
Expand Up @@ -65,4 +65,5 @@ declare module '*.svg' {
export default content
}

type PromiseReturnType<F> = ReturnType<F> extends Promise<infer T> ? T : never
declare type PromiseReturnType<F> = ReturnType<F> extends Promise<infer T> ? T : never
declare type PropsTypeFromFC<T extends Function> = Omit<T extends (...args: infer A) => any ? A[0] : never, 'children'>

0 comments on commit 6c3885d

Please sign in to comment.