Skip to content

Commit

Permalink
Manually fix types for LTI annotations in xplat/js
Browse files Browse the repository at this point in the history
Summary:
This diff makes the manual changes necessary to fix many of the errors in the stacked diff codemod.

See https://fb.workplace.com/groups/flowlang/posts/917522612186736 for details on this effort.

Reviewed By: bradzacher

Differential Revision: D31615035

fbshipit-source-id: 179b2df516833d59873b9003350f81eb4a6b4e9d
  • Loading branch information
evanyeung authored and facebook-github-bot committed Nov 10, 2021
1 parent f10741a commit 83a1791
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Libraries/Animated/nodes/AnimatedValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const AnimatedWithChildren = require('./AnimatedWithChildren');
const InteractionManager = require('../../Interaction/InteractionManager');
const NativeAnimatedHelper = require('../NativeAnimatedHelper');

import type AnimatedNode from './AnimatedNode';
import type Animation, {EndCallback} from '../animations/Animation';
import type {InterpolationConfigType} from './AnimatedInterpolation';
import type AnimatedTracking from './AnimatedTracking';
Expand Down Expand Up @@ -45,7 +46,7 @@ const NativeAnimatedAPI = NativeAnimatedHelper.API;
*/
function _flush(rootNode: AnimatedValue): void {
const animatedStyles = new Set();
function findAnimatedStyles(node) {
function findAnimatedStyles(node: AnimatedValue | AnimatedNode) {
/* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the error
* delete this comment and run Flow. */
Expand Down
11 changes: 10 additions & 1 deletion Libraries/Image/ImageBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import * as React from 'react';
import StyleSheet from '../StyleSheet/StyleSheet';
import flattenStyle from '../StyleSheet/flattenStyle';
import View from '../Components/View/View';
import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
import type {ImageBackgroundProps} from './ImageProps';
import type {ViewProps} from '../Components/View/ViewPropTypes';

/**
* Very simple drop-in replacement for <Image> which supports nesting views.
Expand Down Expand Up @@ -52,7 +54,14 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {

_viewRef: ?React.ElementRef<typeof View> = null;

_captureRef = ref => {
_captureRef = (
ref: null | React$ElementRef<
React$AbstractComponent<
ViewProps,
React.ElementRef<HostComponent<ViewProps>>,
>,
>,
) => {
this._viewRef = ref;
};

Expand Down
9 changes: 6 additions & 3 deletions Libraries/LogBox/UI/LogBoxNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @format
*/

import type {Message as MessageType} from '../Data/parseLogBoxLog';
import * as React from 'react';
import Image from '../../Image/Image';
import StyleSheet from '../../StyleSheet/StyleSheet';
Expand Down Expand Up @@ -54,7 +55,9 @@ function LogBoxLogNotification(props: Props): React.Node {
);
}

function CountBadge(props) {
function CountBadge(
props: $TEMPORARY$object<{count: number, level: 'error' | 'warn'}>,
) {
return (
<View style={countStyles.outside}>
{/* $FlowFixMe[incompatible-type] (>=0.114.0) This suppression was added
Expand All @@ -69,7 +72,7 @@ function CountBadge(props) {
);
}

function Message(props) {
function Message(props: $TEMPORARY$object<{message: MessageType}>) {
return (
<View style={messageStyles.container}>
<Text numberOfLines={1} style={messageStyles.text}>
Expand All @@ -85,7 +88,7 @@ function Message(props) {
);
}

function DismissButton(props) {
function DismissButton(props: $TEMPORARY$object<{onPress: () => void}>) {
return (
<View style={dismissStyles.container}>
<LogBoxButton
Expand Down

0 comments on commit 83a1791

Please sign in to comment.