Skip to content

Commit ad341e3

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Add as const cast and make types readonly to prepare for natural inference (#47184)
Summary: Pull Request resolved: #47184 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D64859497 fbshipit-source-id: 2cff5e2671e210a4e8cefb5a2d8c0fb56d5a0d1b
1 parent 5e21232 commit ad341e3

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ if (hairlineWidth === 0) {
170170
hairlineWidth = 1 / PixelRatio.get();
171171
}
172172

173-
const absoluteFill = {
173+
const absoluteFill: {
174+
+bottom: 0,
175+
+left: 0,
176+
+position: 'absolute',
177+
+right: 0,
178+
+top: 0,
179+
} = {
174180
position: 'absolute',
175181
left: 0,
176182
right: 0,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7889,11 +7889,11 @@ export type ImageStyle = ____ImageStyle_Internal;
78897889
export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal;
78907890
declare let hairlineWidth: number;
78917891
declare const absoluteFill: {
7892-
position: \\"absolute\\",
7893-
left: 0,
7894-
right: 0,
7895-
top: 0,
7896-
bottom: 0,
7892+
+bottom: 0,
7893+
+left: 0,
7894+
+position: \\"absolute\\",
7895+
+right: 0,
7896+
+top: 0,
78977897
};
78987898
declare module.exports: {
78997899
hairlineWidth: hairlineWidth,

packages/virtualized-lists/Lists/ViewabilityHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type ViewabilityConfigCallbackPair = {
3535
...
3636
};
3737

38-
export type ViewabilityConfig = {|
38+
export type ViewabilityConfig = $ReadOnly<{|
3939
/**
4040
* Minimum amount of time (in milliseconds) that an item must be physically viewable before the
4141
* viewability callback will be fired. A high number means that scrolling through content without
@@ -62,7 +62,7 @@ export type ViewabilityConfig = {|
6262
* render.
6363
*/
6464
waitForInteraction?: boolean,
65-
|};
65+
|}>;
6666

6767
/**
6868
* A Utility class for calculating viewable items based on current metrics like scroll position and

0 commit comments

Comments
 (0)