Skip to content

Commit

Permalink
pre-suppress this typing errors ahead of 154
Browse files Browse the repository at this point in the history
Summary:
This pre-suppresses the 154 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D29065246

fbshipit-source-id: f418041305a46df410dcbe3d9a4db81a61ac7014
  • Loading branch information
dsainati1 authored and facebook-github-bot committed Jun 11, 2021
1 parent 050922a commit 974f0a3
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions IntegrationTests/TimersTest.js
Expand Up @@ -262,6 +262,7 @@ class TimersTest extends React.Component<Props, State> {
this.clearInterval(this._interval);
this._interval = null;
}
// $FlowFixMe[method-unbinding]
this.setState({count: 0}, this._nextTest);
return;
}
Expand Down
1 change: 1 addition & 0 deletions Libraries/Animated/animations/TimingAnimation.js
Expand Up @@ -48,6 +48,7 @@ let _easeInOut;
function easeInOut() {
if (!_easeInOut) {
const Easing = require('../Easing');
// $FlowFixMe[method-unbinding]
_easeInOut = Easing.inOut(Easing.ease);
}
return _easeInOut;
Expand Down
2 changes: 2 additions & 0 deletions Libraries/BugReporting/BugReporting.js
Expand Up @@ -43,6 +43,7 @@ class BugReporting {
if (!BugReporting._subscription) {
BugReporting._subscription = RCTDeviceEventEmitter.addListener(
'collectBugExtraData',
// $FlowFixMe[method-unbinding]
BugReporting.collectExtraData,
null,
);
Expand All @@ -52,6 +53,7 @@ class BugReporting {
if (!BugReporting._redboxSubscription) {
BugReporting._redboxSubscription = RCTDeviceEventEmitter.addListener(
'collectRedBoxExtraData',
// $FlowFixMe[method-unbinding]
BugReporting.collectExtraData,
null,
);
Expand Down
14 changes: 14 additions & 0 deletions Libraries/Components/Touchable/Touchable.js
Expand Up @@ -418,6 +418,7 @@ const TouchableMixin = {
* @param {SyntheticEvent} e Synthetic event from event system.
*
*/
// $FlowFixMe[signature-verification-failure]
touchableHandleResponderGrant: function(e: PressEvent) {
const dispatchID = e.currentTarget;
// Since e is used in a callback invoked on another event loop
Expand Down Expand Up @@ -459,6 +460,7 @@ const TouchableMixin = {
/**
* Place as callback for a DOM element's `onResponderRelease` event.
*/
// $FlowFixMe[signature-verification-failure]
touchableHandleResponderRelease: function(e: PressEvent) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
Expand All @@ -467,6 +469,7 @@ const TouchableMixin = {
/**
* Place as callback for a DOM element's `onResponderTerminate` event.
*/
// $FlowFixMe[signature-verification-failure]
touchableHandleResponderTerminate: function(e: PressEvent) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
Expand All @@ -475,6 +478,7 @@ const TouchableMixin = {
/**
* Place as callback for a DOM element's `onResponderMove` event.
*/
// $FlowFixMe[signature-verification-failure]
touchableHandleResponderMove: function(e: PressEvent) {
// Measurement may not have returned yet.
if (!this.state.touchable.positionOnActivate) {
Expand Down Expand Up @@ -560,6 +564,7 @@ const TouchableMixin = {
* element that was blurred just prior to this. This can be overridden when
* using `Touchable.Mixin.withoutDefaultFocusAndBlur`.
*/
// $FlowFixMe[signature-verification-failure]
touchableHandleFocus: function(e: Event) {
this.props.onFocus && this.props.onFocus(e);
},
Expand All @@ -572,6 +577,7 @@ const TouchableMixin = {
* This can be overridden when using
* `Touchable.Mixin.withoutDefaultFocusAndBlur`.
*/
// $FlowFixMe[signature-verification-failure]
touchableHandleBlur: function(e: Event) {
this.props.onBlur && this.props.onBlur(e);
},
Expand Down Expand Up @@ -665,6 +671,7 @@ const TouchableMixin = {
}
},

// $FlowFixMe[signature-verification-failure]
_handleQueryLayout: function(
l: number,
t: number,
Expand All @@ -691,11 +698,13 @@ const TouchableMixin = {
);
},

// $FlowFixMe[signature-verification-failure]
_handleDelay: function(e: PressEvent) {
this.touchableDelayTimeout = null;
this._receiveSignal(Signals.DELAY, e);
},

// $FlowFixMe[signature-verification-failure]
_handleLongDelay: function(e: PressEvent) {
this.longPressDelayTimeout = null;
const curState = this.state.touchable.touchState;
Expand All @@ -715,6 +724,7 @@ const TouchableMixin = {
* @throws Error if invalid state transition or unrecognized signal.
* @sideeffects
*/
// $FlowFixMe[signature-verification-failure]
_receiveSignal: function(signal: Signal, e: PressEvent) {
const responderID = this.state.touchable.responderID;
const curState = this.state.touchable.touchState;
Expand Down Expand Up @@ -766,6 +776,7 @@ const TouchableMixin = {
);
},

// $FlowFixMe[signature-verification-failure]
_savePressInLocation: function(e: PressEvent) {
const touch = extractSingleTouch(e.nativeEvent);
const pageX = touch && touch.pageX;
Expand Down Expand Up @@ -797,6 +808,7 @@ const TouchableMixin = {
* @param {Event} e Native event.
* @sideeffects
*/
// $FlowFixMe[signature-verification-failure]
_performSideEffectsForTransition: function(
curState: State,
nextState: State,
Expand Down Expand Up @@ -858,11 +870,13 @@ const TouchableMixin = {
this.touchableDelayTimeout = null;
},

// $FlowFixMe[signature-verification-failure]
_startHighlight: function(e: PressEvent) {
this._savePressInLocation(e);
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
},

// $FlowFixMe[signature-verification-failure]
_endHighlight: function(e: PressEvent) {
if (this.touchableHandleActivePressOut) {
if (
Expand Down
1 change: 1 addition & 0 deletions Libraries/Components/Touchable/TouchableOpacity.js
Expand Up @@ -188,6 +188,7 @@ class TouchableOpacity extends React.Component<Props, State> {
Animated.timing(this.state.anim, {
toValue,
duration,
// $FlowFixMe[method-unbinding]
easing: Easing.inOut(Easing.quad),
useNativeDriver: true,
}).start();
Expand Down
1 change: 1 addition & 0 deletions Libraries/Interaction/InteractionMixin.js
Expand Up @@ -33,6 +33,7 @@ const InteractionMixin = {
return handle;
},

// $FlowFixMe[signature-verification-failure]
clearInteractionHandle: function(clearHandle: number): void {
InteractionManager.clearInteractionHandle(clearHandle);
this._interactionMixinHandles = this._interactionMixinHandles.filter(
Expand Down
1 change: 1 addition & 0 deletions Libraries/Lists/VirtualizedSectionList.js
Expand Up @@ -605,6 +605,7 @@ function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {

/* $FlowFixMe[class-object-subtyping] added when improving typing for this
* parameters */
// $FlowFixMe[method-unbinding]
module.exports = (VirtualizedSectionList: React.AbstractComponent<
React.ElementConfig<typeof VirtualizedSectionList>,
$ReadOnly<{
Expand Down
1 change: 1 addition & 0 deletions Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js
Expand Up @@ -36,6 +36,7 @@ function LogBoxInspectorSourceMapStatus(props: Props): React.Node {
const animation = Animated.loop(
Animated.timing(animated, {
duration: 2000,
// $FlowFixMe[method-unbinding]
easing: Easing.linear,
toValue: 1,
useNativeDriver: true,
Expand Down
1 change: 1 addition & 0 deletions Libraries/Storage/AsyncStorage.js
Expand Up @@ -237,6 +237,7 @@ const AsyncStorage = {
*
* See https://reactnative.dev/docs/asyncstorage.html#multiget
*/
// $FlowFixMe[signature-verification-failure]
multiGet: function(
keys: Array<string>,
callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void,
Expand Down
1 change: 1 addition & 0 deletions Libraries/YellowBox/YellowBoxDeprecated.js
Expand Up @@ -67,6 +67,7 @@ if (__DEV__) {
};
}

// $FlowFixMe[method-unbinding]
module.exports = (YellowBox: Class<React.Component<Props>> & {
ignoreWarnings($ReadOnlyArray<IgnorePattern>): void,
install(): void,
Expand Down
Expand Up @@ -421,6 +421,7 @@ module.exports = {
})
.join('\n');

// $FlowFixMe[missing-type-arg]
const moduleLookups = Object.keys(nativeModules)
.filter(hasteModuleName => {
const module = nativeModules[hasteModuleName];
Expand Down
Expand Up @@ -144,6 +144,7 @@ class StructCollector {
resolveAlias: AliasResolver,
objectTypeAnnotation: NativeModuleObjectTypeAnnotation,
): void {
// $FlowFixMe[missing-type-arg]
const properties = objectTypeAnnotation.properties.map<
$ReadOnly<{
name: string,
Expand Down
Expand Up @@ -223,6 +223,7 @@ function serializeRegularStruct(
.join('\n '),
});

// $FlowFixMe[missing-type-arg]
const methods = struct.properties
.map<string>(property => {
const {typeAnnotation, optional, name: propName} = property;
Expand Down
Expand Up @@ -144,6 +144,7 @@ function serializeMethod(
/**
* Build ObjC Selector
*/
// $FlowFixMe[missing-type-arg]
const selector = methodParams
.map<string>(({paramName}) => paramName)
.reduce(($selector, paramName, i) => {
Expand Down Expand Up @@ -422,6 +423,7 @@ function serializeConstantsProtocolMethods(

const returnObjCType = `facebook::react::ModuleConstants<JS::${hasteModuleName}::Constants::Builder>`;

// $FlowFixMe[missing-type-arg]
return ['constantsToExport', 'getConstants'].map<MethodSerializationOutput>(
methodName => {
const protocolMethod = ProtocolMethodTemplate({
Expand Down
Expand Up @@ -219,6 +219,7 @@ function translateTypeAnnotation(
case 'ObjectTypeAnnotation': {
const objectTypeAnnotation = {
type: 'ObjectTypeAnnotation',
// $FlowFixMe[missing-type-arg]
properties: (typeAnnotation.properties: Array<$FlowFixMe>)
.map<?NamedShape<Nullable<NativeModuleBaseTypeAnnotation>>>(
property => {
Expand Down Expand Up @@ -669,6 +670,7 @@ function buildModuleSchema(
}
});

// $FlowFixMe[missing-type-arg]
return (moduleSpec.body.properties: $ReadOnlyArray<$FlowFixMe>)
.filter(property => property.type === 'ObjectTypeProperty')
.map<?{
Expand Down
2 changes: 2 additions & 0 deletions packages/rn-tester/js/examples/Alert/AlertIOSExample.js
Expand Up @@ -64,6 +64,7 @@ class PromptOptions extends React.Component<Props, State> {
<TouchableHighlight
style={styles.wrapper}
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
// $FlowFixMe[incompatible-call]
onPress={() => Alert.prompt('Type a value', null, this.saveResponse)}>
<View style={styles.button}>
<Text>prompt with title & callback</Text>
Expand Down Expand Up @@ -104,6 +105,7 @@ class PromptOptions extends React.Component<Props, State> {
'Type a value',
null,
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
// $FlowFixMe[incompatible-call]
this.saveResponse,
undefined,
'Default value',
Expand Down
Expand Up @@ -30,6 +30,8 @@ export default ({
description: ('Sequence, parallel, delay, and ' +
'stagger with different easing functions.': string),
render: function(): React.Node {
// $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]
this.anims = this.anims || [1, 2, 3].map(() => new Animated.Value(0));
return (
<View>
Expand All @@ -38,12 +40,15 @@ export default ({
const timing = Animated.timing;
Animated.sequence([
// One after the other
// $FlowFixMe[incompatible-use]
timing(this.anims[0], {
toValue: 200,
// $FlowFixMe[method-unbinding]
easing: Easing.linear,
useNativeDriver: false,
}),
Animated.delay(400), // Use with sequence
// $FlowFixMe[incompatible-use]
timing(this.anims[0], {
toValue: 0,

Expand All @@ -55,6 +60,7 @@ export default ({
Animated.delay(400),
Animated.stagger(
200,
// $FlowFixMe[incompatible-use]
this.anims
.map(anim =>
timing(anim, {
Expand All @@ -63,6 +69,7 @@ export default ({
}),
)
.concat(
// $FlowFixMe[incompatible-use]
this.anims.map(anim =>
timing(anim, {
toValue: 0,
Expand All @@ -74,12 +81,15 @@ export default ({
Animated.delay(400),
Animated.parallel(
[
// $FlowFixMe[method-unbinding]
Easing.inOut(Easing.quad), // Symmetric
Easing.back(1.5), // Goes backwards first
Easing.ease, // Default bezier
].map((easing, ii) =>
// $FlowFixMe[incompatible-use]
timing(this.anims[ii], {
toValue: 320,
// $FlowFixMe[method-unbinding]
easing,
duration: 3000,
useNativeDriver: false,
Expand All @@ -89,11 +99,13 @@ export default ({
Animated.delay(400),
Animated.stagger(
200,
// $FlowFixMe[incompatible-use]
this.anims.map(anim =>
timing(anim, {
toValue: 0,

// Like a ball
// $FlowFixMe[method-unbinding]
easing: Easing.bounce,

duration: 2000,
Expand All @@ -111,6 +123,7 @@ export default ({
style={[
styles.content,
{
// $FlowFixMe[incompatible-use]
left: this.anims[ii],
},
]}>
Expand Down
Expand Up @@ -21,11 +21,14 @@ const styles = StyleSheet.create({
});

function RotatingImagesExample(): React.Node {
// $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]
this.anim = this.anim || new Animated.Value(0);
return (
<View>
<RNTesterButton
onPress={() => {
// $FlowFixMe[incompatible-use]
Animated.spring(this.anim, {
// Returns to the start
toValue: 0,
Expand Down Expand Up @@ -57,12 +60,14 @@ function RotatingImagesExample(): React.Node {
}),
},
{
// $FlowFixMe[incompatible-use]
translateX: this.anim.interpolate({
inputRange: [0, 1],
outputRange: [0, 100],
}),
},
{
// $FlowFixMe[incompatible-use]
rotate: this.anim.interpolate({
inputRange: [0, 1],
outputRange: [
Expand Down
Expand Up @@ -33,11 +33,14 @@ export default ({
'an interpolation to convert the value into the ' +
'right range and units.': string),
render: function(): React.Node {
// $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]
this.anim = this.anim || new Animated.Value(0);
return (
<View>
<RNTesterButton
onPress={() => {
// $FlowFixMe[incompatible-use]
Animated.spring(this.anim, {
// Returns to the start
toValue: 0,
Expand Down Expand Up @@ -69,12 +72,14 @@ export default ({
}),
},
{
// $FlowFixMe[incompatible-use]
translateX: this.anim.interpolate({
inputRange: [0, 1],
outputRange: [0, 500],
}),
},
{
// $FlowFixMe[incompatible-use]
rotate: this.anim.interpolate({
inputRange: [0, 1],
outputRange: [
Expand Down

0 comments on commit 974f0a3

Please sign in to comment.