(children: ReactNodeList, options: Options)
| 44 | }; |
| 45 | |
| 46 | function renderToStream(children: ReactNodeList, options: Options): Stream { |
| 47 | const destination = { |
| 48 | buffer: '', |
| 49 | done: false, |
| 50 | fatal: false, |
| 51 | error: null, |
| 52 | }; |
| 53 | const resumableState = createResumableState( |
| 54 | options ? options.identifierPrefix : undefined, |
| 55 | options ? options.unstable_externalRuntimeSrc : undefined, |
| 56 | options ? options.bootstrapScriptContent : undefined, |
| 57 | options ? options.bootstrapScripts : undefined, |
| 58 | options ? options.bootstrapModules : undefined, |
| 59 | ); |
| 60 | const request = createRequest( |
| 61 | children, |
| 62 | resumableState, |
| 63 | createRenderState( |
| 64 | resumableState, |
| 65 | undefined, |
| 66 | options ? options.unstable_externalRuntimeSrc : undefined, |
| 67 | ), |
| 68 | createRootFormatContext(undefined), |
| 69 | options ? options.progressiveChunkSize : undefined, |
| 70 | options.onError, |
| 71 | undefined, |
| 72 | undefined, |
| 73 | ); |
| 74 | startWork(request); |
| 75 | if (destination.fatal) { |
| 76 | throw destination.error; |
| 77 | } |
| 78 | return { |
| 79 | destination, |
| 80 | request, |
| 81 | }; |
| 82 | } |
| 83 | |
| 84 | function abortStream(stream: Stream, reason: mixed): void { |
| 85 | abort(stream.request, reason); |
no test coverage detected