mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Similar to Fizz, Flight now supports a return value from the user provided onError option. If a value is returned from onError it will be serialized and provided to the client. The digest is stashed on the constructed Error on the client as .digest
35 lines
690 B
JavaScript
35 lines
690 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 {ModuleMetaData} from 'ReactFlightDOMRelayServerIntegration';
|
|
|
|
export type JSONValue =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| {+[key: string]: JSONValue}
|
|
| $ReadOnlyArray<JSONValue>;
|
|
|
|
export type RowEncoding =
|
|
| ['J', number, JSONValue]
|
|
| ['M', number, ModuleMetaData]
|
|
| ['P', number, string]
|
|
| ['S', number, string]
|
|
| [
|
|
'E',
|
|
number,
|
|
{
|
|
digest: string,
|
|
message?: string,
|
|
stack?: string,
|
|
...
|
|
},
|
|
];
|