File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,6 @@ export {
14
14
withAssetPrefix ,
15
15
} from "gatsby-link"
16
16
17
- export interface StaticQueryProps {
18
- query : any
19
- render ?: RenderCallback
20
- children ?: RenderCallback
21
- }
22
-
23
17
export const useStaticQuery : < TData = any > ( query : any ) => TData
24
18
25
19
export const parsePath : ( path : string ) => WindowLocation
@@ -40,12 +34,12 @@ export interface PageRendererProps {
40
34
*/
41
35
export class PageRenderer extends React . Component < PageRendererProps > { }
42
36
43
- type RenderCallback = ( data : any ) => React . ReactNode
37
+ type RenderCallback < T = any > = ( data : T ) => React . ReactNode
44
38
45
- export interface StaticQueryProps {
39
+ export interface StaticQueryProps < T = any > {
46
40
query : any
47
- render ?: RenderCallback
48
- children ?: RenderCallback
41
+ render ?: RenderCallback < T >
42
+ children ?: RenderCallback < T >
49
43
}
50
44
51
45
/**
@@ -58,7 +52,9 @@ export interface StaticQueryProps {
58
52
* @see https://www.gatsbyjs.org/docs/static-query/
59
53
*/
60
54
61
- export class StaticQuery extends React . Component < StaticQueryProps > { }
55
+ export class StaticQuery < T = any > extends React . Component <
56
+ StaticQueryProps < T >
57
+ > { }
62
58
63
59
/**
64
60
* graphql is a tag function. Behind the scenes Gatsby handles these tags in a particular way
You can’t perform that action at this time.
0 commit comments