File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ declare module '.' {
3636 interface PreloadOptions {
3737 as : PreloadAs ;
3838 crossOrigin ?: string | undefined ;
39+ fetchPriority ?: 'high' | 'low' | 'auto' ;
3940 integrity ?: string | undefined ;
4041 }
4142 function preload ( href : string , options ?: PreloadOptions ) : void ;
@@ -44,9 +45,10 @@ declare module '.' {
4445 interface PreinitOptions {
4546 as : PreinitAs ;
4647 crossOrigin ?: string | undefined ;
47- precedence ?: string | undefined ;
48+ fetchPriority ?: 'high' | 'low' | 'auto' ;
4849 integrity ?: string | undefined ;
4950 nonce ?: string | undefined ;
51+ precedence ?: string | undefined ;
5052 }
5153 function preinit ( href : string , options ?: PreinitOptions ) : void ;
5254}
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ function preloadTest() {
1414 // @ts -expect-error -- Only allowed in preinit
1515 nonce : '0xeac1' ,
1616 } ) ;
17+ ReactDOM . preload ( 'foo' , { as : 'style' , fetchPriority : 'auto' } ) ;
18+ ReactDOM . preload ( 'foo' , { as : 'style' , fetchPriority : 'high' } ) ;
19+ ReactDOM . preload ( 'foo' , { as : 'style' , fetchPriority : 'low' } ) ;
20+ ReactDOM . preload ( 'foo' , {
21+ as : 'style' ,
22+ // @ts -expect-error
23+ fetchPriority : 'unknown' ,
24+ } ) ;
1725
1826 ReactDOM . preinit ( 'foo' , {
1927 as : 'style' ,
@@ -36,5 +44,13 @@ function preloadTest() {
3644 as : 'script' ,
3745 nonce : '0xeac1' ,
3846 } ) ;
47+ ReactDOM . preinit ( 'foo' , { as : 'style' , fetchPriority : 'auto' } ) ;
48+ ReactDOM . preinit ( 'foo' , { as : 'style' , fetchPriority : 'high' } ) ;
49+ ReactDOM . preinit ( 'foo' , { as : 'style' , fetchPriority : 'low' } ) ;
50+ ReactDOM . preinit ( 'foo' , {
51+ as : 'style' ,
52+ // @ts -expect-error
53+ fetchPriority : 'unknown' ,
54+ } ) ;
3955 }
4056}
You can’t perform that action at this time.
0 commit comments