Skip to content

Commit 8b0856e

Browse files
Fix flow checks
1 parent a35be0c commit 8b0856e

File tree

9 files changed

+26
-18
lines changed

9 files changed

+26
-18
lines changed

packages/react-native/Libraries/Alert/Alert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ class Alert {
276276
static promptMacOS(
277277
title: ?string,
278278
message?: ?string,
279-
callbackOrButtons?: ?((text: string) => void) | Buttons,
279+
callbackOrButtons?: ?((text: string) => void) | AlertButtons,
280280
type?: ?AlertType = 'plain-text',
281281
defaultInputs?: DefaultInputsArray,
282282
modal?: ?boolean,

packages/react-native/Libraries/Components/TextInput/TextInput.flow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ export type TextInputEditingEvent =
9898
NativeSyntheticEvent<TextInputEndEditingEventData>;
9999

100100
// [macOS macOS-only
101-
export type SettingChangeEvent = SyntheticEvent<
101+
export type SettingChangeEvent = NativeSyntheticEvent<
102102
$ReadOnly<{|
103103
autoCorrectEnabled: boolean,
104104
spellCheckEnabled: boolean,
105105
grammarCheckEnabled: boolean,
106106
|}>,
107107
>;
108108

109-
export type PasteEvent = SyntheticEvent<
109+
export type PasteEvent = NativeSyntheticEvent<
110110
$ReadOnly<{|
111111
dataTransfer: {|
112112
files: $ReadOnlyArray<{|

packages/react-native/Libraries/Components/TextInput/TextInput.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ export type TextInputEditingEvent =
133133
NativeSyntheticEvent<TextInputEndEditingEventData>;
134134

135135
// [macOS macOS-only
136-
export type SettingChangeEvent = SyntheticEvent<
136+
export type SettingChangeEvent = NativeSyntheticEvent<
137137
$ReadOnly<{|
138138
autoCorrectEnabled: boolean,
139139
spellCheckEnabled: boolean,
140140
grammarCheckEnabled: boolean,
141141
|}>,
142142
>;
143143

144-
export type PasteEvent = SyntheticEvent<
144+
export type PasteEvent = NativeSyntheticEvent<
145145
$ReadOnly<{|
146146
dataTransfer: {|
147147
files: $ReadOnlyArray<{|
@@ -943,7 +943,7 @@ export type TextInputProps = $ReadOnly<{
943943
/**
944944
* Callback that is called when the text input is focused.
945945
*/
946-
onFocus?: ?(e: TextInputFocusEvent) => void, // [macOS]
946+
onFocus?: ?(e: TextInputFocusEvent) => void, // [macOS]
947947

948948
/**
949949
* Callback that is called when a key is pressed.

packages/react-native/Libraries/Components/Touchable/Touchable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const extractSingleTouch = (nativeEvent: {
4545
return !hasTouches && hasChangedTouches
4646
? changedTouches[0]
4747
: hasTouches
48-
? touches[0]
49-
: nativeEvent;
48+
? touches[0]
49+
: nativeEvent;
5050
};
5151

5252
/**

packages/react-native/Libraries/Types/CoreEventTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export type NativeScrollPoint = $ReadOnly<{
284284
}>;
285285

286286
// [macOS
287-
export type KeyEvent = SyntheticEvent<
287+
export type KeyEvent = NativeSyntheticEvent<
288288
$ReadOnly<{|
289289
// Modifier keys
290290
capsLockKey: boolean,

packages/react-native/Libraries/Utilities/Platform.macos.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ const Platform: PlatformType = {
8787
'macos' in spec
8888
? spec.macos
8989
: 'native' in spec
90-
? spec.native
91-
: spec.default,
90+
? spec.native
91+
: spec.default,
9292
};
9393

9494
export default Platform;

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ declare class Alert {
100100
static promptMacOS(
101101
title: ?string,
102102
message?: ?string,
103-
callbackOrButtons?: ?((text: string) => void) | Buttons,
103+
callbackOrButtons?: ?((text: string) => void) | AlertButtons,
104104
type?: ?AlertType,
105105
defaultInputs?: DefaultInputsArray,
106106
modal?: ?boolean,
@@ -2702,14 +2702,14 @@ export type TextInputEndEditingEventData = $ReadOnly<{
27022702
}>;
27032703
export type TextInputEditingEvent =
27042704
NativeSyntheticEvent<TextInputEndEditingEventData>;
2705-
export type SettingChangeEvent = SyntheticEvent<
2705+
export type SettingChangeEvent = NativeSyntheticEvent<
27062706
$ReadOnly<{|
27072707
autoCorrectEnabled: boolean,
27082708
spellCheckEnabled: boolean,
27092709
grammarCheckEnabled: boolean,
27102710
|}>,
27112711
>;
2712-
export type PasteEvent = SyntheticEvent<
2712+
export type PasteEvent = NativeSyntheticEvent<
27132713
$ReadOnly<{|
27142714
dataTransfer: {|
27152715
files: $ReadOnlyArray<{|
@@ -3110,14 +3110,14 @@ export type TextInputEndEditingEventData = $ReadOnly<{
31103110
}>;
31113111
export type TextInputEditingEvent =
31123112
NativeSyntheticEvent<TextInputEndEditingEventData>;
3113-
export type SettingChangeEvent = SyntheticEvent<
3113+
export type SettingChangeEvent = NativeSyntheticEvent<
31143114
$ReadOnly<{|
31153115
autoCorrectEnabled: boolean,
31163116
spellCheckEnabled: boolean,
31173117
grammarCheckEnabled: boolean,
31183118
|}>,
31193119
>;
3120-
export type PasteEvent = SyntheticEvent<
3120+
export type PasteEvent = NativeSyntheticEvent<
31213121
$ReadOnly<{|
31223122
dataTransfer: {|
31233123
files: $ReadOnlyArray<{|
@@ -8513,7 +8513,7 @@ export type NativeScrollPoint = $ReadOnly<{
85138513
y: number,
85148514
x: number,
85158515
}>;
8516-
export type KeyEvent = SyntheticEvent<
8516+
export type KeyEvent = NativeSyntheticEvent<
85178517
$ReadOnly<{|
85188518
capsLockKey: boolean,
85198519
shiftKey: boolean,
@@ -9581,6 +9581,10 @@ export { default as UTFSequence } from \\"./Libraries/UTFSequence\\";
95819581
export { default as Vibration } from \\"./Libraries/Vibration/Vibration\\";
95829582
export { default as DeviceEventEmitter } from \\"./Libraries/EventEmitter/RCTDeviceEventEmitter\\";
95839583
export { DynamicColorIOS } from \\"./Libraries/StyleSheet/PlatformColorValueTypesIOS\\";
9584+
export {
9585+
ColorWithSystemEffectMacOS,
9586+
DynamicColorMacOS,
9587+
} from \\"./Libraries/StyleSheet/PlatformColorValueTypesMacOS\\";
95849588
export { default as NativeAppEventEmitter } from \\"./Libraries/EventEmitter/RCTNativeAppEventEmitter\\";
95859589
export { default as NativeModules } from \\"./Libraries/BatchedBridge/NativeModules\\";
95869590
export { default as Platform } from \\"./Libraries/Utilities/Platform\\";

packages/react-native/index.js.flow

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ export {default as Vibration} from './Libraries/Vibration/Vibration';
104104

105105
export {default as DeviceEventEmitter} from './Libraries/EventEmitter/RCTDeviceEventEmitter';
106106
export {DynamicColorIOS} from './Libraries/StyleSheet/PlatformColorValueTypesIOS';
107+
export {
108+
ColorWithSystemEffectMacOS,
109+
DynamicColorMacOS,
110+
} from './Libraries/StyleSheet/PlatformColorValueTypesMacOS'; // [macOS]
107111
export {default as NativeAppEventEmitter} from './Libraries/EventEmitter/RCTNativeAppEventEmitter';
108112
export {default as NativeModules} from './Libraries/BatchedBridge/NativeModules';
109113
export {default as Platform} from './Libraries/Utilities/Platform';

packages/virtualized-lists/Lists/VirtualizedList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ class VirtualizedList extends StateSafePureComponent<
14941494
_selectRowAtIndex = (rowIndex: number) => {
14951495
const prevIndex = this.state.selectedRowIndex;
14961496
const newIndex = rowIndex;
1497-
this.setState({selectedRowIndex: newIndex});
1497+
this.setState<'selectedRowIndex'>({selectedRowIndex: newIndex});
14981498

14991499
this.ensureItemAtIndexIsVisible(newIndex);
15001500
if (prevIndex !== newIndex) {

0 commit comments

Comments
 (0)