@@ -40,12 +40,12 @@ type SuspenseInstance = {
4040} ;
4141
4242type Placeholder = {
43- parent : Instance | SuspenseInstance ,
43+ parent : Instance | Segment | SuspenseInstance ,
4444index : number ,
4545} ;
4646
4747type Segment = {
48- children : null | Instance | TextInstance | SuspenseInstance ,
48+ children : Array < Instance | TextInstance | SuspenseInstance > ,
4949} ;
5050
5151type Destination = {
@@ -79,6 +79,7 @@ function write(destination: Destination, buffer: Uint8Array): void {
7979stack . push ( instance ) ;
8080}
8181
82+ // $FlowFixMe[prop-missing]
8283const ReactNoopServer = ReactFizzServer ( {
8384scheduleMicrotask ( callback : ( ) => void ) {
8485callback ( ) ;
@@ -175,6 +176,7 @@ const ReactNoopServer = ReactFizzServer({
175176destination : Destination ,
176177renderState : RenderState ,
177178id : number ,
179+ // $FlowFixMe[incompatible-return]
178180) : boolean {
179181const parent = destination . stack [ destination . stack . length - 1 ] ;
180182destination . placeholders . set ( id , {
@@ -258,7 +260,7 @@ const ReactNoopServer = ReactFizzServer({
258260formatContext : null ,
259261id : number ,
260262) : boolean {
261- const segment = {
263+ const segment : Segment = {
262264children : [ ] ,
263265} ;
264266destination . segments . set ( id , segment ) ;
@@ -314,6 +316,7 @@ const ReactNoopServer = ReactFizzServer({
314316renderState : RenderState ,
315317boundary : SuspenseInstance ,
316318) : boolean {
319+ // $FlowFixMe[prop-missing]
317320boundary . status = 'client-render' ;
318321return true ;
319322} ,
@@ -357,6 +360,7 @@ type Options = {
357360} ;
358361
359362function render ( children : React$Element < any > , options ?: Options ) : Destination {
363+ // $FlowFixMe[prop-missing]
360364const destination : Destination = {
361365root : null ,
362366placeholders : new Map ( ) ,
@@ -368,15 +372,19 @@ function render(children: React$Element<any>, options?: Options): Destination {
368372} ;
369373const request = ReactNoopServer . createRequest (
370374children ,
375+ // $FlowFixMe[incompatible-call]
371376null ,
377+ // $FlowFixMe[incompatible-call]
372378null ,
379+ // $FlowFixMe[incompatible-call]
373380null ,
374381options ? options . progressiveChunkSize : undefined ,
375382options ? options . onError : undefined ,
376383options ? options . onAllReady : undefined ,
377384options ? options . onShellReady : undefined ,
378385) ;
379386ReactNoopServer . startWork ( request ) ;
387+ // $FlowFixMe[incompatible-call]
380388ReactNoopServer . startFlowing ( request , destination ) ;
381389return destination ;
382390}
0 commit comments