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 @@ -22,7 +22,7 @@ import type {TypeDeclarationMap} from '../../utils';
const {getValueFromTypes} = require('../utils.js');

// $FlowFixMe[unclear-type] there's no flowtype for ASTs
type EventTypeAST = Object;
type EventTypeAST = any;

function buildCommandSchema(
property: EventTypeAST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ function buildEventSchema(
}

// $FlowFixMe[unclear-type] there's no flowtype for ASTs
type EventTypeAST = Object;
type EventTypeAST = any;

type TypeMap = {
// $FlowFixMe[unclear-type] there's no flowtype for ASTs
[string]: Object,
[string]: any,
...
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export type CommandOptions = Readonly<{
}>;

// $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser
type OptionsAST = Object;
type OptionsAST = any;

type ExtendedPropResult = {
type: 'ReactNativeBuiltInType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const {parseTopLevelType} = require('../parseTopLevelType');
const {getPrimitiveTypeAnnotation} = require('./componentsUtils');

// $FlowFixMe[unclear-type] there's no flowtype for ASTs
type EventTypeAST = Object;
type EventTypeAST = any;

function buildCommandSchemaInternal(
name: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function findEventArgumentsAndType(
}

// $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser
type EventTypeAST = Object;
type EventTypeAST = any;

function buildEventSchema(
types: TypeDeclarationMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function isEvent(typeAnnotation: $FlowFixMe, parser: Parser): boolean {
}

// $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser
type PropsAST = Object;
type PropsAST = any;

function categorizeProps(
typeDefinition: ReadonlyArray<PropsAST>,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Animated/AnimatedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function validateMapping(argMapping: ReadonlyArray<?Mapping>, args: any) {
export class AnimatedEvent {
_argMapping: ReadonlyArray<?Mapping>;
// $FlowFixMe[unclear-type]
_listeners: Array<Function> = [];
_listeners: Array<any> = [];
_attachedEvent: ?{detach: () => void, ...};
__isNative: boolean;
__platformConfig: ?PlatformConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ const _combineCallbacks = function (
const maybeVectorAnim = function (
value: AnimatedValue | AnimatedValueXY | AnimatedColor,
// $FlowFixMe[unclear-type]
config: Object,
config: any,
// $FlowFixMe[unclear-type]
anim: (value: AnimatedValue, config: Object) => CompositeAnimation,
anim: (value: AnimatedValue, config: any) => CompositeAnimation,
): ?CompositeAnimation {
if (value instanceof AnimatedValueXY) {
const configX = {...config};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default class AnimatedNode {
}

// $FlowFixMe[unclear-type]
__getNativeConfig(): Object {
__getNativeConfig(): any {
throw new Error(
'This JS animated node type cannot be used as native animated node',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class AnimatedProps extends AnimatedNode {
}

// $FlowFixMe[unclear-type]
__getValue(): Object {
__getValue(): any {
const props: {[string]: unknown} = {};

const keys = Object.keys(this._props);
Expand All @@ -146,7 +146,7 @@ export default class AnimatedProps extends AnimatedNode {
* created by this `AnimatedProps` instance.
*/
// $FlowFixMe[unclear-type]
__getValueWithStaticProps(staticProps: Object): Object {
__getValueWithStaticProps(staticProps: any): any {
const props: {[string]: unknown} = {...staticProps};

const keys = Object.keys(staticProps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class AnimatedTransform extends AnimatedWithChildren {

__getValueWithStaticTransforms(
// $FlowFixMe[unclear-type]
staticTransforms: ReadonlyArray<Object>,
staticTransforms: ReadonlyArray<any>,
// $FlowFixMe[unclear-type]
): ReadonlyArray<Object> {
const values = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Core/ExceptionsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function reportException(
}

// $FlowFixMe[unclear-type]
const extraData: Object = {
const extraData: any = {
// $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow
...e[decoratedExtraDataKey],
jsEngine: e.jsEngine,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ class PushNotificationIOS {
* See https://reactnative.dev/docs/pushnotificationios#getdeliverednotifications
*/
static getDeliveredNotifications(
// $FlowFixMe[unclear-type]
callback: (notifications: Array<Object>) => void,
callback: (notifications: Array<LegacyObject>) => void,
): void {
invariant(
NativePushNotificationManagerIOS,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/scripts/spm/spm-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function deriveAppName(
}

// $FlowFixMe[unclear-type] JSON data has dynamic shape
function readPackageJson(dir /*: string */) /*: Object | null */ {
function readPackageJson(dir /*: string */) /*: any | null */ {
const pkgPath = path.join(dir, 'package.json');
if (!fs.existsSync(pkgPath)) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface NativeAnimatedModuleSpec extends NativeAnimatedTurboModuleSpec {
readonly connectAnimatedNodeToShadowNodeFamily?: (
nodeTag: number,
// $FlowExpectedError[unclear-type].
shadowNode: Object,
shadowNode: any,
) => void;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/IntegrationTests/AppEventsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {TestModule} = NativeModules;
const TEST_PAYLOAD = {foo: 'bar'};

type AppEvent = {
data: Object,
data: any,
ts: number,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/js/components/ListExampleShared.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function renderSmallSwitchOption(
);
}

function PlainInput(props: Object): React.Node {
function PlainInput(props: any): React.Node {
return (
<TextInput
autoCapitalize="none"
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester/js/components/RNTesterExampleFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const {
} = require('react-native');

type Props<T> = {
filter: Function,
render: Function,
filter: any,
render: any,
disableSearch?: boolean,
testID?: string,
hideFilterPills?: boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Circle extends React.Component<any, any> {
},
};
}
const animatedStyle: Object = {
const animatedStyle: any = {
shadowOpacity: this.state.pop, // no need for interpolation (step2d: uncomment)
transform: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const styles = StyleSheet.create({
},
});

function computeNewSelected(gestureState: Object): ?number {
function computeNewSelected(gestureState: any): ?number {
const {dx, dy} = gestureState;
let minDist = Infinity;
let newSelected = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class RNTesterPlatformTestEventRecorder {
export function useRecorderTestEventHandlers(
eventRecorder: RNTesterPlatformTestEventRecorder,
targetNames: ReadonlyArray<string>,
callback?: (event: Object, eventType: string, targetName: string) => void,
callback?: (event: any, eventType: string, targetName: string) => void,
): Readonly<{[targetName: string]: ViewProps}> {
return useMemo(
() => eventRecorder.createRecorderTestEventHandlers(targetNames, callback),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const OrientationChangeExample = (): React.Node => {
});

useEffect(() => {
const onOrientationChange = (orientation: Object) => {
const onOrientationChange = (orientation: any) => {
setState({
currentOrientation: orientation.name,
orientationDegrees: orientation.rotationDegrees,
Expand Down
6 changes: 3 additions & 3 deletions packages/rn-tester/js/examples/RTL/RTLExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type RTLToggleState = {isRTL: boolean, ...};

type AnimationState = {
toggleStatus: any,
linear: Object,
linear: any,
windowWidth: number,
...
};
Expand Down Expand Up @@ -297,13 +297,13 @@ class AnimationExample extends React.Component<any, AnimationState> {
);
}

_onLayout = (e: Object) => {
_onLayout = (e: any) => {
this.setState({
windowWidth: e.nativeEvent.layout.width,
});
};

_linearTap = (e: Object) => {
_linearTap = (e: any) => {
this.setState({
toggleStatus: {
...this.state.toggleStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export component SectionList_scrollable() {
if (logViewable) {
console.log(
'onViewableItemsChanged: ',
info.changed.map((v: Object) => ({
info.changed.map((v: any) => ({
...v,
item: '...',
section: v.section.key,
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester/js/examples/XHR/XHRExampleDownload.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function roundKilo(value: number): number {
return Math.round(value / 1000);
}

class XHRExampleDownload extends React.Component<{...}, Object> {
state: Object = {
class XHRExampleDownload extends React.Component<{...}, any> {
state: any = {
downloading: false,
// set by onreadystatechange
contentLength: 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/js/examples/XHR/XHRExampleFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {

class XHRExampleFetch extends React.Component<any, any> {
responseURL: ?string;
responseHeaders: ?Object;
responseHeaders: ?any;
intervalId: ?ReturnType<typeof setInterval>;

constructor(props: any) {
Expand Down
8 changes: 4 additions & 4 deletions packages/virtualized-lists/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class VirtualizedList extends StateSafePureComponent<
}
}

setNativeProps(props: Object) {
setNativeProps(props: LegacyObject) {
if (this._scrollRef) {
this._scrollRef.setNativeProps(props);
}
Expand Down Expand Up @@ -929,7 +929,7 @@ class VirtualizedList extends StateSafePureComponent<
}

_pushCells(
cells: Array<Object>,
cells: Array<any>,
stickyHeaderIndices: Array<number>,
stickyIndicesFromProps: ?Set<number>,
first: number,
Expand Down Expand Up @@ -1015,7 +1015,7 @@ class VirtualizedList extends StateSafePureComponent<
};
}

_onUpdateSeparators = (keys: Array<?string>, newProps: Object) => {
_onUpdateSeparators = (keys: Array<?string>, newProps: any) => {
keys.forEach(key => {
const ref = key != null && this._cellRefs[key];
ref && ref.updateSeparatorProps(newProps);
Expand Down Expand Up @@ -1939,7 +1939,7 @@ class VirtualizedList extends StateSafePureComponent<
this._onScroll(e);
}

_onScroll = (e: Object) => {
_onScroll = (e: any) => {
this._nestedChildLists.forEach(childList => {
childList._onScroll(e);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/virtualized-lists/Lists/VirtualizedListProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type Item = any;
export type Separators = {
highlight: () => void,
unhighlight: () => void,
updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,
updateProps: (select: 'leading' | 'trailing', newProps: LegacyObject) => void,
...
};

Expand Down
4 changes: 2 additions & 2 deletions packages/virtualized-lists/Lists/VirtualizedSectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class VirtualizedSectionList<

_getSeparatorComponent(
index: number,
info?: ?Object,
info?: ?any,
listItemCount: number,
): ?(React.ComponentType<any> | React.MixedElement) {
info = info || this._subExtractor(index);
Expand Down Expand Up @@ -502,7 +502,7 @@ type ItemWithSeparatorProps<ItemT> = Readonly<{
prevCellKey?: ?string,
updateHighlightFor: (prevCellKey: string, value: boolean) => void,
updatePropsFor: (prevCellKey: string, value: Object) => void,
renderItem: Function,
renderItem: any,
inverted: boolean,
}>;

Expand Down
Loading