Skip to content

Commit 66c9fed

Browse files
author
Brian Vaughn
committed
Flow fixes
1 parent fe943c3 commit 66c9fed

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function InspectedElementContextController({children}: Props) {
135135
const value = hydrateHelper(data.value, data.path);
136136
const inspectedElement = {...currentlyInspectedElement};
137137

138-
fillInPath(inspectedElement, data.path, value);
138+
fillInPath(inspectedElement, data.value, data.path, value);
139139

140140
resource.write(element, inspectedElement);
141141

packages/react-devtools-shared/src/devtools/views/Components/types.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// @flow
22

3-
import type {Dehydrated} from 'react-devtools-shared/src/hydration';
3+
import type {
4+
Dehydrated,
5+
Unserializable,
6+
} from 'react-devtools-shared/src/hydration';
47
import type {ElementType} from 'react-devtools-shared/src/types';
58

69
// Each element on the frontend corresponds to a Fiber on the backend.
@@ -87,7 +90,9 @@ export type DehydratedData = {|
8790
data:
8891
| string
8992
| Dehydrated
93+
| Unserializable
9094
| Array<Dehydrated>
91-
| {[key: string]: string | Dehydrated},
95+
| Array<Unserializable>
96+
| {[key: string]: string | Dehydrated | Unserializable},
9297
unserializable: Array<Array<string | number>>,
9398
|};

packages/react-devtools-shared/src/hydration.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export type Dehydrated = {|
4242
// These objects can't be serialized without losing type information,
4343
// so a "Unserializable" type wrapper is used (with meta-data keys) to send nested values-
4444
// while preserving the original type and name.
45-
type Unserializable = {
45+
export type Unserializable = {
4646
name: string | null,
4747
readonly?: boolean,
4848
size?: number,
@@ -196,6 +196,8 @@ export function dehydrate(
196196
| string
197197
| Dehydrated
198198
| Unserializable
199+
| Array<Dehydrated>
200+
| Array<Unserializable>
199201
| {[key: string]: string | Dehydrated | Unserializable} {
200202
const type = getDataType(data);
201203

@@ -380,7 +382,7 @@ export function fillInPath(
380382
}
381383

382384
export function hydrate(
383-
object: Object,
385+
object: any,
384386
cleaned: Array<Array<string | number>>,
385387
unserializable: Array<Array<string | number>>,
386388
): Object {

0 commit comments

Comments
 (0)