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
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ packages/react-native/flow/

[options]
enums=true
as_const=true
casting_syntax=both

emoji=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2673,7 +2673,7 @@ const UNION_MODULE: SchemaType = {
},
};

const STRING_LITERALS = {
const STRING_LITERALS: SchemaType = {
modules: {
NativeSampleTurboModule: {
type: 'NativeModule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const Presets = {
'opacity',
): LayoutAnimationConfig),
linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),
spring: {
spring: ({
duration: 700,
create: {
type: 'linear',
Expand All @@ -135,7 +135,7 @@ const Presets = {
type: 'linear',
property: 'opacity',
},
},
}: LayoutAnimationConfig),
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5609,12 +5609,7 @@ declare function create(
declare const Presets: {
easeInEaseOut: LayoutAnimationConfig,
linear: LayoutAnimationConfig,
spring: {
duration: 700,
create: { type: \\"linear\\", property: \\"opacity\\" },
update: { type: \\"spring\\", springDamping: 0.4 },
delete: { type: \\"linear\\", property: \\"opacity\\" },
},
spring: LayoutAnimationConfig,
};
declare const LayoutAnimation: {
configureNext: configureNext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @flow strict-local
*/

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import type {Node} from 'react';

import React, {useCallback, useEffect, useRef, useState} from 'react';
Expand Down Expand Up @@ -152,4 +153,4 @@ exports.examples = [
return <ActivityIndicator style={styles.centering} size={75} />;
},
},
];
] as Array<RNTesterModuleExample>;
3 changes: 2 additions & 1 deletion packages/rn-tester/js/examples/AppState/AppStateExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

'use strict';

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import type {AppStateValues} from 'react-native/Libraries/AppState/AppState';
import type {EventSubscription} from 'react-native/Libraries/vendor/emitter/EventEmitter';

Expand Down Expand Up @@ -159,4 +160,4 @@ exports.examples = [
return <AppStateSubscription detectEvents={true} />;
},
},
];
] as Array<RNTesterModuleExample>;
3 changes: 2 additions & 1 deletion packages/rn-tester/js/examples/Filter/FilterExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

'use strict';

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';

import React from 'react';
Expand Down Expand Up @@ -228,4 +229,4 @@ exports.examples = [
);
},
},
];
] as Array<RNTesterModuleExample>;
3 changes: 2 additions & 1 deletion packages/rn-tester/js/examples/Image/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

'use strict';

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import type {ImageProps} from 'react-native/Libraries/Image/ImageProps';
import type {LayoutEvent} from 'react-native/Libraries/Types/CoreEventTypes';

Expand Down Expand Up @@ -1809,4 +1810,4 @@ exports.examples = [
},
platform: 'android',
},
];
] as Array<RNTesterModuleExample>;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @format
*/

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';

import * as MutationObserverExample from './MutationObserverExample';
import * as VisualCompletionExample from './VisualCompletionExample/VisualCompletionExample';

Expand All @@ -18,7 +20,7 @@ export const documentationURL =
'https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver';
export const description = 'API to detect mutations in React Native nodes.';
export const showIndividualExamples = true;
export const examples = [MutationObserverExample];
export const examples: Array<RNTesterModuleExample> = [MutationObserverExample];

if (typeof IntersectionObserver !== 'undefined') {
examples.push(VisualCompletionExample);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/

'use strict';

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';

import SectionListBaseExample from './SectionListBaseExample';
import * as React from 'react';
import {StyleSheet, Text, View} from 'react-native';
Expand Down Expand Up @@ -81,4 +84,4 @@ export default {
render: function (): React.MixedElement {
return <SectionList_contentInset />;
},
};
} as RNTesterModuleExample;
4 changes: 3 additions & 1 deletion packages/rn-tester/js/examples/StatusBar/StatusBarExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

'use strict';

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';

import RNTesterText from '../../components/RNTesterText';
import React from 'react';
import {
Expand Down Expand Up @@ -515,7 +517,7 @@ exports.examples = [
},
platform: 'android',
},
];
] as Array<RNTesterModuleExample>;

const styles = StyleSheet.create({
container: {
Expand Down
4 changes: 3 additions & 1 deletion packages/rn-tester/js/examples/Touchable/TouchableExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @flow
*/

import type {RNTesterModuleExample} from '../../types/RNTesterTypes';

import RNTesterText from '../../components/RNTesterText';
import React from 'react';
import {useEffect, useRef, useState} from 'react';
Expand Down Expand Up @@ -799,4 +801,4 @@ exports.examples = [
return <TouchableDisabled />;
},
},
];
] as Array<RNTesterModuleExample>;
2 changes: 1 addition & 1 deletion packages/rn-tester/js/utils/RNTesterNavigationReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const RNTesterNavigationActionsType = {
EXAMPLE_CARD_PRESS: 'EXAMPLE_CARD_PRESS',
EXAMPLE_OPEN_URL_REQUEST: 'EXAMPLE_OPEN_URL_REQUEST',
NAVBAR_OPEN_MODULE_PRESS: 'NAVBAR_OPEN_MODULE_PRESS',
};
} as const;

const getUpdatedRecentlyUsed = ({
exampleType,
Expand Down
Loading