File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ declare module '.' {
5555
5656 export function use < T > ( usable : Usable < T > ) : T ;
5757
58- interface ServerContextJSONArray extends ReadonlyArray < ServerContextJSONArray > { }
58+ interface ServerContextJSONArray extends ReadonlyArray < ServerContextJSONValue > { }
5959 export type ServerContextJSONValue =
6060 | string
6161 | boolean
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ function serverContextTest() {
4242
4343 // plain objects work
4444 React . createServerContext ( 'PlainObjectContext' , { foo : 1 } ) ;
45+ // readonly arrays work
46+ React . createServerContext ( 'ReadonlyArrayContext' , [ 'foo' , 'bar' ] as const ) ;
47+ // nested readonly arrays work
48+ React . createServerContext ( 'ReadonlyArrayContext' , [ 'foo' , [ 'bar' ] ] as const ) ;
4549 // @ts -expect-error Incompatible with JSON stringify+parse
4650 React . createServerContext ( 'DateContext' , new Date ( ) ) ;
4751 // @ts -expect-error Incompatible with JSON stringify+parse
You can’t perform that action at this time.
0 commit comments