Skip to content

Commit 57367c6

Browse files
authored
Update Flow to 0.84 (#17805)
* Update Flow to 0.84 * Fix violations * Use inexact object syntax in files from fbsource * Fix warning extraction to use a modern parser * Codemod inexact objects to new syntax * Tighten types that can be exact * Revert unintentional formatting changes from codemod
1 parent 9ec4453 commit 57367c6

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/ReactShallowRenderer.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ import type {ReactElement} from 'shared/ReactElementType';
2727
type BasicStateAction<S> = (S => S) | S;
2828
type Dispatch<A> = A => void;
2929

30-
type Update<A> = {
30+
type Update<A> = {|
3131
action: A,
3232
next: Update<A> | null,
33-
};
33+
|};
3434

35-
type UpdateQueue<A> = {
35+
type UpdateQueue<A> = {|
3636
first: Update<A> | null,
3737
dispatch: any,
38-
};
38+
|};
3939

40-
type Hook = {
40+
type Hook = {|
4141
memoizedState: any,
4242
queue: UpdateQueue<any> | null,
4343
next: Hook | null,
44-
};
44+
|};
4545

4646
const {ReactCurrentDispatcher} = ReactSharedInternals;
4747

@@ -340,7 +340,7 @@ class ReactShallowRenderer {
340340
return nextValue;
341341
};
342342

343-
const useRef = <T>(initialValue: T): {current: T} => {
343+
const useRef = <T>(initialValue: T): {|current: T|} => {
344344
this._validateCurrentlyRenderingComponent();
345345
this._createWorkInProgressHook();
346346
const previousRef = (this._workInProgressHook: any).memoizedState;

src/ReactTestHostConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export function prepareUpdate(
195195
newProps: Props,
196196
rootContainerInstance: Container,
197197
hostContext: Object,
198-
): null | {} {
198+
): null | {...} {
199199
return UPDATE_SIGNAL;
200200
}
201201

@@ -246,7 +246,7 @@ export const supportsMutation = true;
246246

247247
export function commitUpdate(
248248
instance: Instance,
249-
updatePayload: {},
249+
updatePayload: {...},
250250
type: string,
251251
oldProps: Props,
252252
newProps: Props,

src/ReactTestRenderer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ import {ConcurrentRoot, LegacyRoot} from 'shared/ReactRootTags';
5050
type TestRendererOptions = {
5151
createNodeMock: (element: React$Element<any>) => any,
5252
unstable_isConcurrent: boolean,
53+
...
5354
};
5455

5556
type ReactTestRendererJSON = {|
5657
type: string,
57-
props: {[propName: string]: any},
58+
props: {[propName: string]: any, ...},
5859
children: null | Array<ReactTestRendererNode>,
5960
$$typeof?: Symbol, // Optional because we add it with defineProperty().
6061
|};
@@ -64,6 +65,7 @@ type FindOptions = $Shape<{
6465
// performs a "greedy" search: if a matching node is found, will continue
6566
// to search within the matching node's children. (default: true)
6667
deep: boolean,
68+
...
6769
}>;
6870

6971
export type Predicate = (node: ReactTestInstance) => ?boolean;

0 commit comments

Comments
 (0)