Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export default class AnimatedStyle extends AnimatedWithChildren {
}
}

/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
return Platform.OS === 'web' ? [this.#inputStyle, style] : style;
}

Expand Down Expand Up @@ -172,6 +174,8 @@ export default class AnimatedStyle extends AnimatedWithChildren {
}
}

/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
return Platform.OS === 'web' ? [this.#inputStyle, style] : style;
}

Expand Down
16 changes: 8 additions & 8 deletions packages/react-native/Libraries/Core/setUpTimers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ if (global.RN$Bridgeless !== true) {
*/
const defineLazyTimer = (
name:
| $TEMPORARY$string<'cancelAnimationFrame'>
| $TEMPORARY$string<'cancelIdleCallback'>
| $TEMPORARY$string<'clearInterval'>
| $TEMPORARY$string<'clearTimeout'>
| $TEMPORARY$string<'requestAnimationFrame'>
| $TEMPORARY$string<'requestIdleCallback'>
| $TEMPORARY$string<'setInterval'>
| $TEMPORARY$string<'setTimeout'>,
| 'cancelAnimationFrame'
| 'cancelIdleCallback'
| 'clearInterval'
| 'clearTimeout'
| 'requestAnimationFrame'
| 'requestIdleCallback'
| 'setInterval'
| 'setTimeout',
) => {
polyfillGlobal(name, () => require('./Timers/JSTimers')[name]);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function StackFrameList(props: {
}

function StackFrameFooter(
props: $TEMPORARY$object<{message: string, onPress: () => void}>,
props: $ReadOnly<{message: string, onPress: () => void}>,
) {
return (
<View style={stackStyles.collapseContainer}>
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/Libraries/Pressability/HoverState.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Platform from '../Utilities/Platform';

let isEnabled = false;

/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
if (Platform.OS === 'web') {
const canUseDOM = Boolean(
typeof window !== 'undefined' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,22 @@ describe('Pressability', () => {

beforeEach(() => {
originalPlatform = Platform.OS;
/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
Platform.OS = 'web';
// $FlowExpectedError[prop-missing]
HoverState.isHoverEnabled.mockReturnValue(true);
});

afterEach(() => {
/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
Platform.OS = originalPlatform;
});

it('is ignored on unsupported platforms`', () => {
/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
Platform.OS = 'ios';
const {handlers} = createMockPressability();
expect(handlers.onMouseEnter).toBeUndefined();
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/Libraries/Utilities/Platform.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type PlatformSelectSpec<T> = {

type IOSPlatform = {
__constants: null,
OS: $TEMPORARY$string<'ios'>,
OS: 'ios',
// $FlowFixMe[unsafe-getters-setters]
get Version(): string,
// $FlowFixMe[unsafe-getters-setters]
Expand Down Expand Up @@ -54,7 +54,7 @@ type IOSPlatform = {

type AndroidPlatform = {
__constants: null,
OS: $TEMPORARY$string<'android'>,
OS: 'android',
// $FlowFixMe[unsafe-getters-setters]
get Version(): number,
// $FlowFixMe[unsafe-getters-setters]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9096,7 +9096,7 @@ exports[`public API should not change unintentionally Libraries/Utilities/Platfo
};
type IOSPlatform = {
__constants: null,
OS: $TEMPORARY$string<\\"ios\\">,
OS: \\"ios\\",
get Version(): string,
get constants(): {|
forceTouchAvailable: boolean,
Expand All @@ -9123,7 +9123,7 @@ type IOSPlatform = {
};
type AndroidPlatform = {
__constants: null,
OS: $TEMPORARY$string<\\"android\\">,
OS: \\"android\\",
get Version(): number,
get constants(): {|
isTesting: boolean,
Expand Down
8 changes: 4 additions & 4 deletions packages/rn-tester/js/components/RNTesterNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* @flow strict-local
*/

import type {RNTesterTheme} from './RNTesterTheme';
import type {ScreenTypes} from '../types/RNTesterTypes';
import type {RNTesterTheme} from './RNTesterTheme';

import {RNTesterThemeContext} from './RNTesterTheme';
import * as React from 'react';
Expand Down Expand Up @@ -56,7 +56,7 @@ const ComponentTab = ({
isComponentActive,
handleNavBarPress,
theme,
}: $TEMPORARY$object<{
}: $ReadOnly<{
handleNavBarPress: NavBarOnPressHandler,
isComponentActive: boolean,
theme: RNTesterTheme,
Expand All @@ -77,7 +77,7 @@ const PlaygroundTab = ({
isComponentActive,
handleNavBarPress,
theme,
}: $TEMPORARY$object<{
}: $ReadOnly<{
handleNavBarPress: NavBarOnPressHandler,
isComponentActive: boolean,
theme: RNTesterTheme,
Expand All @@ -98,7 +98,7 @@ const APITab = ({
isAPIActive,
handleNavBarPress,
theme,
}: $TEMPORARY$object<{
}: $ReadOnly<{
handleNavBarPress: NavBarOnPressHandler,
isAPIActive: boolean,
theme: RNTesterTheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class XHRExampleBinaryUpload extends React.Component<{...}, $FlowFixMeState> {
Linking.openURL(url);
}

state: $FlowFixMe | {|type: $TEMPORARY$string<'Uint8Array'>|} = {
state: $FlowFixMe | {|type: 'Uint8Array'|} = {
type: 'Uint8Array',
};

Expand Down