Skip to content
Open
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
2 changes: 1 addition & 1 deletion flow-typed/environment/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ type child_process$spawnSyncRet<T extends string | Buffer> = Readonly<{
// TODO: subprocess.status may be null in case of error or signal
status: number,
signal: string | null,
error: Error | void,
error: Error | undefined,
}>;

type child_process$spawnSyncOpts = Readonly<{
Expand Down
2 changes: 1 addition & 1 deletion flow-typed/npm/babel-traverse_v7.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ declare module '@babel/traverse' {

bindingIdentifierEquals(name: string, node: BabelNode): boolean;

getBinding(name: string): Binding | void;
getBinding(name: string): Binding | undefined;

getOwnBinding(name: string): Binding | void;

Expand Down
2 changes: 1 addition & 1 deletion flow-typed/npm/execa_v5.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare module 'execa' {
cwd?: string,
detached?: boolean,
encoding?: string,
env?: {[key: string]: string | void, ...},
env?: Readonly<{[key: string]: string | void, ...}>,
extendEnv?: boolean,
gid?: number,
killSignal?: string | number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function findEventArgumentsAndType(
parser: Parser,
typeAnnotation: $FlowFixMe,
types: TypeMap,
bubblingType: void | 'direct' | 'bubble',
bubblingType: ?('direct' | 'bubble'),
paperName: ?$FlowFixMe,
): EventArgumentReturnType {
throwIfEventHasNoName(typeAnnotation, parser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ function handleEventHandler(
parser: Parser,
typeAnnotation: $FlowFixMe,
types: TypeDeclarationMap,
bubblingType: void | 'direct' | 'bubble',
bubblingType: ?('direct' | 'bubble'),
paperName: ?$FlowFixMe,
) => EventArgumentReturnType,
): EventArgumentReturnType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function findEventArgumentsAndType(
parser: Parser,
typeAnnotation: $FlowFixMe,
types: TypeDeclarationMap,
bubblingType: void | 'direct' | 'bubble',
bubblingType: ?('direct' | 'bubble'),
paperName: ?$FlowFixMe,
): {
argumentProps: ?ReadonlyArray<$FlowFixMe>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class TouchableNativeFeedback extends React.Component<
this.state.pressability.configure(this._createPressabilityConfig());
}

componentDidMount(): unknown {
componentDidMount(): void {
this.state.pressability.configure(this._createPressabilityConfig());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ export default class Pressability {
}
};
}
// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
return {
...focusEventHandlers,
...responderEventHandlers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ const AppContainer = ({
externalInspection.externalInspectingEnabled) && (
<InspectorDeferred
inspectedViewRef={innerViewRef}
// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
reactDevToolsAgent={reactDevToolsAgent}
devMenuInspectorOpen={shouldRenderInspector}
externalInspection={externalInspection}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {HardwareBackPressEvent} from './HardwareBackPressEvent';
const DEVICE_BACK_EVENT = 'hardwareBackPress';

type BackPressEventName = 'backPress' | 'hardwareBackPress';
type BackPressHandler = (event: HardwareBackPressEvent) => ?boolean;
type BackPressHandler = (event: HardwareBackPressEvent) => ?boolean | void;

const _backPressSubscriptions: Array<BackPressHandler> = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import type {HardwareBackPressEvent} from './HardwareBackPressEvent';

type BackPressEventName = 'backPress' | 'hardwareBackPress';
type BackPressHandler = (event: HardwareBackPressEvent) => ?boolean;
type BackPressHandler = (event: HardwareBackPressEvent) => ?boolean | void;

function emptyFunction(): void {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type TBackHandler = {
exitApp(): void,
addEventListener(
eventName: BackPressEventName,
handler: (event: HardwareBackPressEvent) => ?boolean,
handler: (event: HardwareBackPressEvent) => ?boolean | void,
): {remove: () => void, ...},
};

Expand Down
16 changes: 8 additions & 8 deletions packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<cbbc40aa5288a930d9b8f35034449096>>
* @generated SignedSource<<1844fb63742cd2547a287716f2881ac4>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand Down Expand Up @@ -4949,7 +4949,7 @@ declare type TaskProvider = () => HeadlessTask
declare type TBackHandler = {
addEventListener(
eventName: BackPressEventName,
handler: (event: HardwareBackPressEvent) => boolean | undefined,
handler: (event: HardwareBackPressEvent) => (boolean | undefined) | void,
): {
remove: () => void
}
Expand Down Expand Up @@ -5380,7 +5380,7 @@ declare class TouchableNativeFeedback extends React.Component<
readonly rippleRadius: number | undefined
readonly type: "ThemeAttrAndroid"
}
componentDidMount(): unknown
componentDidMount(): void
componentDidUpdate(
prevProps: TouchableNativeFeedbackProps,
prevState: TouchableNativeFeedbackState,
Expand Down Expand Up @@ -5902,12 +5902,12 @@ export {
AssetDestPathResolver, // 59047424
AssetRegistry, // 6070bb45
AutoCapitalize, // c0e857a0
BackHandler, // f139fc69
BackHandler, // 29f7039a
BackPressEventName, // 4620fb76
BlurEvent, // 00c596e2
BoxShadowValue, // b679703f
Button, // 8a7997de
ButtonInstance, // 6c48e56a
Button, // 8edd088d
ButtonInstance, // cfe07901
ButtonProps, // 2fe658e4
CodegenTypes, // d0052fd4
ColorSchemeName, // 6615edd6
Expand Down Expand Up @@ -6150,8 +6150,8 @@ export {
TouchableHighlight, // 0a900542
TouchableHighlightInstance, // 7fb6781a
TouchableHighlightProps, // d0b13d30
TouchableNativeFeedback, // 06d2a186
TouchableNativeFeedbackInstance, // bb702365
TouchableNativeFeedback, // 4c640471
TouchableNativeFeedbackInstance, // d25e33ae
TouchableNativeFeedbackProps, // 9e5a4301
TouchableOpacity, // 4dac793e
TouchableOpacityInstance, // dca89710
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/scripts/setup-apple-spm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,7 @@ async function main(argv /*:: ?: Array<string> */) /*: Promise<void> */ {
log('Generating autolinking.json (CLI config)...');
autolinkingConfigResult = generateAutolinkingConfigOrFailClosed({
projectRoot,
// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
configCommand: resolveExplicitConfigCommand(args, appRoot),
});
if (autolinkingConfigResult == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ type EventListenerRegistration = {
type ListenersMap = Map<string, Map<EventListener, EventListenerRegistration>>;

export default class EventTarget {
[CAPTURING_LISTENERS_KEY]: ListenersMap | void;
[BUBBLING_LISTENERS_KEY]: ListenersMap | void;
[CAPTURING_LISTENERS_KEY]: ?ListenersMap;
[BUBBLING_LISTENERS_KEY]: ?ListenersMap;

addEventListener(
type: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function ToggleAnimatingActivityIndicator() {
setToggleTimeout();

return () => {
// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
clearTimeout(timer.current);
};
}, [timer, setToggleTimeout]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function ItemFetcherBadExample(props: {
onFetched(items);
// $FlowFixMe[incompatible-type]
}, console.error);
return undefined;
}

function ItemFetcherGoodExample(props: {
Expand All @@ -64,6 +65,7 @@ function ItemFetcherGoodExample(props: {
// $FlowFixMe[incompatible-type]
}, console.error);
}, [onFetched, count]);
return undefined;
}

const ItemFetcherBadExampleMemo = memo(ItemFetcherBadExample);
Expand Down
1 change: 1 addition & 0 deletions packages/rn-tester/js/examples/Snapshot/SnapshotExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ScreenshotExample extends React.Component<{...}, $FlowFixMe> {
style={[style.button, {color: theme.LabelColor}]}>
Click to take a screenshot
</Text>
{/* $FlowFixMe[incompatible-use] `void` is not `undefined` under experimental.ts_void */}
<Image
style={[style.image, {backgroundColor: theme.LabelColor}]}
source={{uri: this.state.uri}}
Expand Down
6 changes: 5 additions & 1 deletion packages/rn-tester/js/utils/JSEventLoopWatchdog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

type Handler = {
onIterate?: () => void,
onStall: (params: {lastInterval: number, busyTime: number, ...}) => ?string,
onStall: (params: {
lastInterval: number,
busyTime: number,
...
}) => ?string | void,
...
};

Expand Down
2 changes: 1 addition & 1 deletion private/react-native-fantom/reporter/terminalImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import {getPngDimensions} from '../runner/screenshots/pngUtils';

export type ImageProtocol = 'iterm2' | 'kitty';
export type TerminalEnvironment = {[key: string]: string | void};
export type TerminalEnvironment = Readonly<{[key: string]: string | void}>;

export function getImageProtocol(
isTTY: ?boolean,
Expand Down
1 change: 1 addition & 0 deletions private/react-native-fantom/runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ module.exports = async function runTest(
});
}

// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
testResultsByConfig.push(testResults);

coverageMap = processedResult.coverageMap || {};
Expand Down
Loading