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
2 changes: 2 additions & 0 deletions packages/dev-middleware/src/inspector-proxy/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,8 @@ export default class Device {
}

if (
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
payload.method === 'Runtime.executionContextCreated' &&
this.#isLegacyPageReloading
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ function getTestCasesForProp(
propValue: typeAnnotation.default != null ? typeAnnotation.default : true,
});
// $FlowFixMe[incompatible-type]
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
} else if (typeAnnotation.type === 'IntegerTypeAnnotation') {
cases.push({
propName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ function buildCommandSchema(
break;
case 'Array':
case '$ReadOnlyArray':
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
if (!paramValue.type === 'GenericTypeAnnotation') {
throw new Error(
'Array and $ReadOnlyArray are GenericTypeAnnotation for array',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function buildCommandSchemaInternal(
break;
case 'Array':
case 'ReadOnlyArray':
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
if (!paramValue.type === 'TSTypeReference') {
throw new Error(
'Array and ReadOnlyArray are TSTypeReference for array',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export default class AnimatedStyle extends AnimatedWithChildren {
const [nodeKeys, nodes, style] = createAnimatedStyle(
flatStyle,
allowlist,
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
Platform.OS !== 'web',
);
if (nodes.length === 0) {
Expand Down
4 changes: 4 additions & 0 deletions packages/react-native/Libraries/AppState/AppState.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ class AppStateImpl {
// $FlowFixMe[invalid-tuple-arity] Flow cannot refine handler based on the event type
const focusOrBlurHandler: () => void = handler;
return emitter.addListener('appStateFocusChange', hasFocus => {
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
if (type === 'blur' && !hasFocus) {
focusOrBlurHandler();
}
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
if (type === 'focus' && hasFocus) {
focusOrBlurHandler();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class DebuggingOverlayRegistry {
let iterator: ?ReadOnlyElement = instance;
while (iterator != null) {
for (const subscriber of this.#registry) {
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
if (subscriber.rootViewRef.current === iterator) {
return subscriber;
}
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 @@ -14,6 +14,8 @@ let isEnabled = false;

/* $FlowFixMe[incompatible-type] Error found due to incomplete typing of
* Platform.flow.js */
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition roll
* out. See https://fburl.com/workplace/4oq3zi07. */
if (Platform.OS === 'web') {
const canUseDOM = Boolean(
typeof window !== 'undefined' &&
Expand Down
12 changes: 12 additions & 0 deletions packages/react-native/Libraries/Utilities/ReactNativeTestTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ function byClickable(): Predicate {
node =>
// note: <Text /> lazy-mounts press handlers after the first press,
// so this is a workaround for targeting text nodes.
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
(node.type === Text &&
node.props &&
typeof node.props.onPress === 'function') ||
// note: Special casing <Switch /> since it doesn't use touchable
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
(node.type === Switch && node.props && node.props.disabled !== true) ||
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
(node.type === View &&
node?.props?.onStartShouldSetResponder?.testOnly_pressabilityConfig) ||
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
(node.type === TouchableWithoutFeedback &&
node.props &&
typeof node.props.onPress === 'function') ||
Expand Down Expand Up @@ -174,8 +182,12 @@ function renderWithStrictMode(element: React.Node): ReactTestRendererType {

function tap(instance: ReactTestInstance) {
const touchable = instance.find(byClickable());
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
if (touchable.type === Text && touchable.props && touchable.props.onPress) {
touchable.props.onPress();
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
} else if (touchable.type === Switch && touchable.props) {
const value = !touchable.props.value;
const {onChange, onValueChange} = touchable.props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,13 @@ const SnapToOptions = () => {
/>
<Button
label={
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
snapToOffsets === [] ? 'setSnapToOffsets' : 'reset snapToOffsets'
}
onPress={() =>
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
snapToOffsets === []
? setSnapToOffsets([2, 4, 6, 8, 10])
: setSnapToOffsets([])
Expand Down
2 changes: 2 additions & 0 deletions private/react-native-fantom/runner/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export function getBuckModesForPlatform(
break;
case 'darwin':
osPlatform =
/* $FlowFixMe[invalid-compare] Error discovered during Constant
* Condition roll out. See https://fburl.com/workplace/4oq3zi07. */
os.arch() === 'arm64'
? `@//arvr/mode/mac-arm/${mode}`
: `@//arvr/mode/mac/${mode}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export function insideTypeAliasLayerWithTypeParam(
}

export function insideIndexedAccessLayer(state: InlineVisitorState): boolean {
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
return state.stack.some(layer => layer.type === 'indexedAccess');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ function createVersionExportedApis(
const value = node[key];
if (Array.isArray(value)) {
value.forEach(item => getTypeReferencesForNode(item, refs));
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
} else if (typeof value === 'object' && value !== null) {
getTypeReferencesForNode(value, refs);
}
Expand Down
Loading