mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
7843b142ac
* Pass in Destination lazily in startFlowing instead of createRequest * Delay fatal errors until we have a destination to forward them to * Flow can now be inferred by whether there's a destination set We can drop the destination when we're not flowing since there's nothing to write to. Fatal errors now close once flowing starts back up again. * Defer fatal errors in Flight too
33 lines
698 B
JavaScript
33 lines
698 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import type {ReactModel} from 'react-server/src/ReactFlightServer';
|
|
import type {
|
|
BundlerConfig,
|
|
Destination,
|
|
} from './ReactFlightNativeRelayServerHostConfig';
|
|
|
|
import {
|
|
createRequest,
|
|
startWork,
|
|
startFlowing,
|
|
} from 'react-server/src/ReactFlightServer';
|
|
|
|
function render(
|
|
model: ReactModel,
|
|
destination: Destination,
|
|
config: BundlerConfig,
|
|
): void {
|
|
const request = createRequest(model, config);
|
|
startWork(request);
|
|
startFlowing(request, destination);
|
|
}
|
|
|
|
export {render};
|