mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Flow fixes
This commit is contained in:
@@ -135,7 +135,7 @@ function InspectedElementContextController({children}: Props) {
|
||||
const value = hydrateHelper(data.value, data.path);
|
||||
const inspectedElement = {...currentlyInspectedElement};
|
||||
|
||||
fillInPath(inspectedElement, data.path, value);
|
||||
fillInPath(inspectedElement, data.value, data.path, value);
|
||||
|
||||
resource.write(element, inspectedElement);
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// @flow
|
||||
|
||||
import type {Dehydrated} from 'react-devtools-shared/src/hydration';
|
||||
import type {
|
||||
Dehydrated,
|
||||
Unserializable,
|
||||
} from 'react-devtools-shared/src/hydration';
|
||||
import type {ElementType} from 'react-devtools-shared/src/types';
|
||||
|
||||
// Each element on the frontend corresponds to a Fiber on the backend.
|
||||
@@ -87,7 +90,9 @@ export type DehydratedData = {|
|
||||
data:
|
||||
| string
|
||||
| Dehydrated
|
||||
| Unserializable
|
||||
| Array<Dehydrated>
|
||||
| {[key: string]: string | Dehydrated},
|
||||
| Array<Unserializable>
|
||||
| {[key: string]: string | Dehydrated | Unserializable},
|
||||
unserializable: Array<Array<string | number>>,
|
||||
|};
|
||||
|
||||
@@ -42,7 +42,7 @@ export type Dehydrated = {|
|
||||
// These objects can't be serialized without losing type information,
|
||||
// so a "Unserializable" type wrapper is used (with meta-data keys) to send nested values-
|
||||
// while preserving the original type and name.
|
||||
type Unserializable = {
|
||||
export type Unserializable = {
|
||||
name: string | null,
|
||||
readonly?: boolean,
|
||||
size?: number,
|
||||
@@ -196,6 +196,8 @@ export function dehydrate(
|
||||
| string
|
||||
| Dehydrated
|
||||
| Unserializable
|
||||
| Array<Dehydrated>
|
||||
| Array<Unserializable>
|
||||
| {[key: string]: string | Dehydrated | Unserializable} {
|
||||
const type = getDataType(data);
|
||||
|
||||
@@ -380,7 +382,7 @@ export function fillInPath(
|
||||
}
|
||||
|
||||
export function hydrate(
|
||||
object: Object,
|
||||
object: any,
|
||||
cleaned: Array<Array<string | number>>,
|
||||
unserializable: Array<Array<string | number>>,
|
||||
): Object {
|
||||
|
||||
Reference in New Issue
Block a user