Skip to content

Commit d86412d

Browse files
SamChou19815facebook-github-bot
authored andcommitted
prepare for primitive literal changes (#47943)
Summary: Pull Request resolved: #47943 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D66461724 fbshipit-source-id: b526ed1617667b70337472f4dad4e19f152a266b
1 parent f70c3ca commit d86412d

File tree

13 files changed

+27
-18
lines changed

13 files changed

+27
-18
lines changed

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ packages/react-native/flow/
4444

4545
[options]
4646
enums=true
47+
as_const=true
4748
casting_syntax=both
4849

4950
emoji=true

packages/react-native-codegen/src/generators/modules/__test_fixtures__/fixtures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2673,7 +2673,7 @@ const UNION_MODULE: SchemaType = {
26732673
},
26742674
};
26752675

2676-
const STRING_LITERALS = {
2676+
const STRING_LITERALS: SchemaType = {
26772677
modules: {
26782678
NativeSampleTurboModule: {
26792679
type: 'NativeModule',

packages/react-native/Libraries/LayoutAnimation/LayoutAnimation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const Presets = {
121121
'opacity',
122122
): LayoutAnimationConfig),
123123
linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),
124-
spring: {
124+
spring: ({
125125
duration: 700,
126126
create: {
127127
type: 'linear',
@@ -135,7 +135,7 @@ const Presets = {
135135
type: 'linear',
136136
property: 'opacity',
137137
},
138-
},
138+
}: LayoutAnimationConfig),
139139
};
140140

141141
/**

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5609,12 +5609,7 @@ declare function create(
56095609
declare const Presets: {
56105610
easeInEaseOut: LayoutAnimationConfig,
56115611
linear: LayoutAnimationConfig,
5612-
spring: {
5613-
duration: 700,
5614-
create: { type: \\"linear\\", property: \\"opacity\\" },
5615-
update: { type: \\"spring\\", springDamping: 0.4 },
5616-
delete: { type: \\"linear\\", property: \\"opacity\\" },
5617-
},
5612+
spring: LayoutAnimationConfig,
56185613
};
56195614
declare const LayoutAnimation: {
56205615
configureNext: configureNext,

packages/rn-tester/js/examples/ActivityIndicator/ActivityIndicatorExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @flow strict-local
99
*/
1010

11+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1112
import type {Node} from 'react';
1213

1314
import React, {useCallback, useEffect, useRef, useState} from 'react';
@@ -152,4 +153,4 @@ exports.examples = [
152153
return <ActivityIndicator style={styles.centering} size={75} />;
153154
},
154155
},
155-
];
156+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/AppState/AppStateExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
'use strict';
1212

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

@@ -159,4 +160,4 @@ exports.examples = [
159160
return <AppStateSubscription detectEvents={true} />;
160161
},
161162
},
162-
];
163+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Filter/FilterExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
'use strict';
1212

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

1516
import React from 'react';
@@ -228,4 +229,4 @@ exports.examples = [
228229
);
229230
},
230231
},
231-
];
232+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/Image/ImageExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
'use strict';
1212

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

@@ -1809,4 +1810,4 @@ exports.examples = [
18091810
},
18101811
platform: 'android',
18111812
},
1812-
];
1813+
] as Array<RNTesterModuleExample>;

packages/rn-tester/js/examples/MutationObserver/MutationObserverIndex.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* @format
99
*/
1010

11+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
12+
1113
import * as MutationObserverExample from './MutationObserverExample';
1214
import * as VisualCompletionExample from './VisualCompletionExample/VisualCompletionExample';
1315

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

2325
if (typeof IntersectionObserver !== 'undefined') {
2426
examples.push(VisualCompletionExample);

packages/rn-tester/js/examples/SectionList/SectionList-contentInset.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010

1111
'use strict';
12+
13+
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
14+
1215
import SectionListBaseExample from './SectionListBaseExample';
1316
import * as React from 'react';
1417
import {StyleSheet, Text, View} from 'react-native';
@@ -81,4 +84,4 @@ export default {
8184
render: function (): React.MixedElement {
8285
return <SectionList_contentInset />;
8386
},
84-
};
87+
} as RNTesterModuleExample;

0 commit comments

Comments
 (0)