Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ node_modules/warning/.*
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

; TODO: Remove this line when RN v0.64 upgrade is complete. We took
; Flow from v0.122 to v0.125 before finishing the upgrade, to more
; gradually handle the deprecation of `suppress_comment`. When we did
; that mini Flow upgrade, one error in RN's code was flagged, and it
; was in this module.
.*/node_modules/react-native/Libraries/ReactNative/PaperUIManager.js

[include]
; Effectively this line warns Flow that this path might be a symlink
; (because the developer might be using `yarn link` to have this point into
Expand Down Expand Up @@ -115,11 +122,5 @@ module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
suppress_comment=\\(.\\|\n\\)*\\$FlowMigrationFudge

[version]
^0.122.0
^0.128.0
20 changes: 9 additions & 11 deletions flow-typed/@react-navigation/bottom-tabs_v5.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module '@react-navigation/bottom-tabs' {
| false
| ''
| $ReadOnlyArray<StyleObj>
| { [name: string]: any, ... };
| {| [name: string]: any |};
declare type ViewStyleProp = StyleObj;
declare type TextStyleProp = StyleObj;
declare type AnimatedViewStyleProp = StyleObj;
Expand Down Expand Up @@ -425,7 +425,7 @@ declare module '@react-navigation/bottom-tabs' {
* Actions, state, etc.
*/

declare export type ScreenParams = { +[key: string]: mixed, ... };
declare export type ScreenParams = {| +[key: string]: mixed |};

declare export type BackAction = {|
+type: 'GO_BACK',
Expand Down Expand Up @@ -474,7 +474,7 @@ declare module '@react-navigation/bottom-tabs' {

declare export type GenericNavigationAction = {|
+type: string,
+payload?: { +[key: string]: mixed, ... },
+payload?: {| +[key: string]: mixed |},
+source?: string,
+target?: string,
|};
Expand Down Expand Up @@ -540,10 +540,9 @@ declare module '@react-navigation/bottom-tabs' {
declare type ActionCreators<
State: NavigationState,
Action: GenericNavigationAction,
> = {
> = {|
+[key: string]: (...args: any) => (Action | State => Action),
...
};
|};
Comment on lines -543 to +545
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, there were substantially more *explicitly* inexact object
types with indexer properties. It doesn't make a lot of sense why
one would want an inexact object with an indexer property, whether
implicitly or explicitly inexact. So, make those exact too.

Hmm, yeah.

These are mostly lightly-edited flowgen output, right? Seems like probably a (minor) bug in flowgen.


declare export type DefaultRouterOptions = {
+initialRouteName?: string,
Expand All @@ -556,7 +555,7 @@ declare module '@react-navigation/bottom-tabs' {
RouterOptions: DefaultRouterOptions,
> = (options: RouterOptions) => Router<State, Action>;

declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... };
declare export type ParamListBase = {| +[key: string]: ?ScreenParams |};

declare export type RouterConfigOptions = {|
+routeNames: $ReadOnlyArray<string>,
Expand Down Expand Up @@ -714,13 +713,12 @@ declare module '@react-navigation/bottom-tabs' {
* Events
*/

declare export type EventMapBase = {
declare export type EventMapBase = {|
+[name: string]: {|
+data?: mixed,
+canPreventDefault?: boolean,
|},
...
};
|};
declare type EventPreventDefaultProperties<Test: boolean> = $If<
Test,
{| +defaultPrevented: boolean, +preventDefault: () => void |},
Expand Down Expand Up @@ -1910,7 +1908,7 @@ declare module '@react-navigation/bottom-tabs' {
declare export type ContainerEventMap = {|
...GlobalEventMap<PossiblyStaleNavigationState>,
+options: {|
+data: {| +options: { +[key: string]: mixed, ... } |},
+data: {| +options: {| +[key: string]: mixed |} |},
+canPreventDefault: false,
|},
+__unsafe_action__: {|
Expand Down
20 changes: 9 additions & 11 deletions flow-typed/@react-navigation/drawer_v5.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module '@react-navigation/drawer' {
| false
| ''
| $ReadOnlyArray<StyleObj>
| { [name: string]: any, ... };
| {| [name: string]: any |};
declare type ViewStyleProp = StyleObj;
declare type TextStyleProp = StyleObj;
declare type AnimatedViewStyleProp = StyleObj;
Expand Down Expand Up @@ -425,7 +425,7 @@ declare module '@react-navigation/drawer' {
* Actions, state, etc.
*/

declare export type ScreenParams = { +[key: string]: mixed, ... };
declare export type ScreenParams = {| +[key: string]: mixed |};

declare export type BackAction = {|
+type: 'GO_BACK',
Expand Down Expand Up @@ -474,7 +474,7 @@ declare module '@react-navigation/drawer' {

declare export type GenericNavigationAction = {|
+type: string,
+payload?: { +[key: string]: mixed, ... },
+payload?: {| +[key: string]: mixed |},
+source?: string,
+target?: string,
|};
Expand Down Expand Up @@ -540,10 +540,9 @@ declare module '@react-navigation/drawer' {
declare type ActionCreators<
State: NavigationState,
Action: GenericNavigationAction,
> = {
> = {|
+[key: string]: (...args: any) => (Action | State => Action),
...
};
|};

declare export type DefaultRouterOptions = {
+initialRouteName?: string,
Expand All @@ -556,7 +555,7 @@ declare module '@react-navigation/drawer' {
RouterOptions: DefaultRouterOptions,
> = (options: RouterOptions) => Router<State, Action>;

declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... };
declare export type ParamListBase = {| +[key: string]: ?ScreenParams |};

declare export type RouterConfigOptions = {|
+routeNames: $ReadOnlyArray<string>,
Expand Down Expand Up @@ -714,13 +713,12 @@ declare module '@react-navigation/drawer' {
* Events
*/

declare export type EventMapBase = {
declare export type EventMapBase = {|
+[name: string]: {|
+data?: mixed,
+canPreventDefault?: boolean,
|},
...
};
|};
declare type EventPreventDefaultProperties<Test: boolean> = $If<
Test,
{| +defaultPrevented: boolean, +preventDefault: () => void |},
Expand Down Expand Up @@ -1910,7 +1908,7 @@ declare module '@react-navigation/drawer' {
declare export type ContainerEventMap = {|
...GlobalEventMap<PossiblyStaleNavigationState>,
+options: {|
+data: {| +options: { +[key: string]: mixed, ... } |},
+data: {| +options: {| +[key: string]: mixed |} |},
+canPreventDefault: false,
|},
+__unsafe_action__: {|
Expand Down
20 changes: 9 additions & 11 deletions flow-typed/@react-navigation/material-top-tabs_v5.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module '@react-navigation/material-top-tabs' {
| false
| ''
| $ReadOnlyArray<StyleObj>
| { [name: string]: any, ... };
| {| [name: string]: any |};
declare type ViewStyleProp = StyleObj;
declare type TextStyleProp = StyleObj;
declare type AnimatedViewStyleProp = StyleObj;
Expand Down Expand Up @@ -425,7 +425,7 @@ declare module '@react-navigation/material-top-tabs' {
* Actions, state, etc.
*/

declare export type ScreenParams = { +[key: string]: mixed, ... };
declare export type ScreenParams = {| +[key: string]: mixed |};

declare export type BackAction = {|
+type: 'GO_BACK',
Expand Down Expand Up @@ -474,7 +474,7 @@ declare module '@react-navigation/material-top-tabs' {

declare export type GenericNavigationAction = {|
+type: string,
+payload?: { +[key: string]: mixed, ... },
+payload?: {| +[key: string]: mixed |},
+source?: string,
+target?: string,
|};
Expand Down Expand Up @@ -540,10 +540,9 @@ declare module '@react-navigation/material-top-tabs' {
declare type ActionCreators<
State: NavigationState,
Action: GenericNavigationAction,
> = {
> = {|
+[key: string]: (...args: any) => (Action | State => Action),
...
};
|};

declare export type DefaultRouterOptions = {
+initialRouteName?: string,
Expand All @@ -556,7 +555,7 @@ declare module '@react-navigation/material-top-tabs' {
RouterOptions: DefaultRouterOptions,
> = (options: RouterOptions) => Router<State, Action>;

declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... };
declare export type ParamListBase = {| +[key: string]: ?ScreenParams |};

declare export type RouterConfigOptions = {|
+routeNames: $ReadOnlyArray<string>,
Expand Down Expand Up @@ -714,13 +713,12 @@ declare module '@react-navigation/material-top-tabs' {
* Events
*/

declare export type EventMapBase = {
declare export type EventMapBase = {|
+[name: string]: {|
+data?: mixed,
+canPreventDefault?: boolean,
|},
...
};
|};
declare type EventPreventDefaultProperties<Test: boolean> = $If<
Test,
{| +defaultPrevented: boolean, +preventDefault: () => void |},
Expand Down Expand Up @@ -1910,7 +1908,7 @@ declare module '@react-navigation/material-top-tabs' {
declare export type ContainerEventMap = {|
...GlobalEventMap<PossiblyStaleNavigationState>,
+options: {|
+data: {| +options: { +[key: string]: mixed, ... } |},
+data: {| +options: {| +[key: string]: mixed |} |},
+canPreventDefault: false,
|},
+__unsafe_action__: {|
Expand Down
20 changes: 9 additions & 11 deletions flow-typed/@react-navigation/native_v5.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module '@react-navigation/native' {
| false
| ''
| $ReadOnlyArray<StyleObj>
| { [name: string]: any, ... };
| {| [name: string]: any |};
declare type ViewStyleProp = StyleObj;
declare type TextStyleProp = StyleObj;
declare type AnimatedViewStyleProp = StyleObj;
Expand Down Expand Up @@ -425,7 +425,7 @@ declare module '@react-navigation/native' {
* Actions, state, etc.
*/

declare export type ScreenParams = { +[key: string]: mixed, ... };
declare export type ScreenParams = {| +[key: string]: mixed |};

declare export type BackAction = {|
+type: 'GO_BACK',
Expand Down Expand Up @@ -474,7 +474,7 @@ declare module '@react-navigation/native' {

declare export type GenericNavigationAction = {|
+type: string,
+payload?: { +[key: string]: mixed, ... },
+payload?: {| +[key: string]: mixed |},
+source?: string,
+target?: string,
|};
Expand Down Expand Up @@ -540,10 +540,9 @@ declare module '@react-navigation/native' {
declare type ActionCreators<
State: NavigationState,
Action: GenericNavigationAction,
> = {
> = {|
+[key: string]: (...args: any) => (Action | State => Action),
...
};
|};

declare export type DefaultRouterOptions = {
+initialRouteName?: string,
Expand All @@ -556,7 +555,7 @@ declare module '@react-navigation/native' {
RouterOptions: DefaultRouterOptions,
> = (options: RouterOptions) => Router<State, Action>;

declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... };
declare export type ParamListBase = {| +[key: string]: ?ScreenParams |};

declare export type RouterConfigOptions = {|
+routeNames: $ReadOnlyArray<string>,
Expand Down Expand Up @@ -714,13 +713,12 @@ declare module '@react-navigation/native' {
* Events
*/

declare export type EventMapBase = {
declare export type EventMapBase = {|
+[name: string]: {|
+data?: mixed,
+canPreventDefault?: boolean,
|},
...
};
|};
declare type EventPreventDefaultProperties<Test: boolean> = $If<
Test,
{| +defaultPrevented: boolean, +preventDefault: () => void |},
Expand Down Expand Up @@ -1910,7 +1908,7 @@ declare module '@react-navigation/native' {
declare export type ContainerEventMap = {|
...GlobalEventMap<PossiblyStaleNavigationState>,
+options: {|
+data: {| +options: { +[key: string]: mixed, ... } |},
+data: {| +options: {| +[key: string]: mixed |} |},
+canPreventDefault: false,
|},
+__unsafe_action__: {|
Expand Down
20 changes: 9 additions & 11 deletions flow-typed/@react-navigation/stack_v5.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module '@react-navigation/stack' {
| false
| ''
| $ReadOnlyArray<StyleObj>
| { [name: string]: any, ... };
| {| [name: string]: any |};
declare type ViewStyleProp = StyleObj;
declare type TextStyleProp = StyleObj;
declare type AnimatedViewStyleProp = StyleObj;
Expand Down Expand Up @@ -425,7 +425,7 @@ declare module '@react-navigation/stack' {
* Actions, state, etc.
*/

declare export type ScreenParams = { +[key: string]: mixed, ... };
declare export type ScreenParams = {| +[key: string]: mixed |};

declare export type BackAction = {|
+type: 'GO_BACK',
Expand Down Expand Up @@ -474,7 +474,7 @@ declare module '@react-navigation/stack' {

declare export type GenericNavigationAction = {|
+type: string,
+payload?: { +[key: string]: mixed, ... },
+payload?: {| +[key: string]: mixed |},
+source?: string,
+target?: string,
|};
Expand Down Expand Up @@ -540,10 +540,9 @@ declare module '@react-navigation/stack' {
declare type ActionCreators<
State: NavigationState,
Action: GenericNavigationAction,
> = {
> = {|
+[key: string]: (...args: any) => (Action | State => Action),
...
};
|};

declare export type DefaultRouterOptions = {
+initialRouteName?: string,
Expand All @@ -556,7 +555,7 @@ declare module '@react-navigation/stack' {
RouterOptions: DefaultRouterOptions,
> = (options: RouterOptions) => Router<State, Action>;

declare export type ParamListBase = { +[key: string]: ?ScreenParams, ... };
declare export type ParamListBase = {| +[key: string]: ?ScreenParams |};

declare export type RouterConfigOptions = {|
+routeNames: $ReadOnlyArray<string>,
Expand Down Expand Up @@ -714,13 +713,12 @@ declare module '@react-navigation/stack' {
* Events
*/

declare export type EventMapBase = {
declare export type EventMapBase = {|
+[name: string]: {|
+data?: mixed,
+canPreventDefault?: boolean,
|},
...
};
|};
declare type EventPreventDefaultProperties<Test: boolean> = $If<
Test,
{| +defaultPrevented: boolean, +preventDefault: () => void |},
Expand Down Expand Up @@ -1910,7 +1908,7 @@ declare module '@react-navigation/stack' {
declare export type ContainerEventMap = {|
...GlobalEventMap<PossiblyStaleNavigationState>,
+options: {|
+data: {| +options: { +[key: string]: mixed, ... } |},
+data: {| +options: {| +[key: string]: mixed |} |},
+canPreventDefault: false,
|},
+__unsafe_action__: {|
Expand Down
Loading