Skip to content

Commit 5681db0

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Remove deprecated StyleSheet.absoluteFill API (#55541)
Summary: Pull Request resolved: #55541 Follows deprecation in 0.82.0. Changelog: [General][Breaking] - Remove deprecated `StyleSheet.absoluteFill` API Reviewed By: cipolleschi Differential Revision: D93223402 fbshipit-source-id: 0ceadf9f5d0741ff94c8e646925bb94145079eda
1 parent 3296af7 commit 5681db0

6 files changed

Lines changed: 4 additions & 35 deletions

File tree

packages/react-native/Libraries/StyleSheet/StyleSheet.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,4 @@ export namespace StyleSheet {
127127
* styles.
128128
*/
129129
export const absoluteFill: AbsoluteFillStyle;
130-
131-
/**
132-
* @deprecated Use `StyleSheet.absoluteFill`.
133-
*/
134-
export const absoluteFillObject: AbsoluteFillStyle;
135130
}

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,6 @@ export default {
109109
*/
110110
absoluteFill,
111111

112-
/**
113-
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
114-
* used to create a customized entry in a `StyleSheet`, e.g.:
115-
*
116-
* const styles = StyleSheet.create({
117-
* wrapper: {
118-
* ...StyleSheet.absoluteFillObject,
119-
* top: 10,
120-
* backgroundColor: 'transparent',
121-
* },
122-
* });
123-
*/
124-
absoluteFillObject: absoluteFill,
125-
126112
/**
127113
* Combines two styles such that `style2` will override any styles in `style1`.
128114
* If either style is falsy, the other one is returned without allocating an

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ declare export const hairlineWidth: number;
4747
*/
4848
declare export const absoluteFill: AbsoluteFillStyle;
4949

50-
/**
51-
* @deprecated Use `StyleSheet.absoluteFill`.
52-
*/
53-
declare export const absoluteFillObject: AbsoluteFillStyle;
54-
5550
/**
5651
* Combines two styles such that style2 will override any styles in style1.
5752
* If either style is falsy, the other one is returned without allocating

packages/react-native/ReactNativeApi.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<6463b0a4f3acbeb07e6759c345b927d8>>
7+
* @generated SignedSource<<70e87b8481aeab750e8c747d9d4d28b1>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -93,7 +93,6 @@ declare const $$ScrollViewNativeComponent: typeof ScrollViewNativeComponent_defa
9393
declare const $$SwitchNativeComponent: ComponentType
9494
declare const $$ViewNativeComponent: typeof ViewNativeComponent_default
9595
declare const absoluteFill: AbsoluteFillStyle
96-
declare const absoluteFillObject: AbsoluteFillStyle
9796
declare const AccessibilityInfo: typeof AccessibilityInfo_default
9897
declare const AccessibilityInfo_default: {
9998
addEventListener<K extends keyof AccessibilityEventDefinitions>(
@@ -1020,7 +1019,6 @@ declare type $$ScrollViewNativeComponent = typeof $$ScrollViewNativeComponent
10201019
declare type $$SwitchNativeComponent = typeof $$SwitchNativeComponent
10211020
declare type $$ViewNativeComponent = typeof $$ViewNativeComponent
10221021
declare type absoluteFill = typeof absoluteFill
1023-
declare type absoluteFillObject = typeof absoluteFillObject
10241022
declare type AbsoluteFillStyle = {
10251023
readonly bottom: 0
10261024
readonly left: 0
@@ -4999,7 +4997,6 @@ declare namespace StyleSheet {
49994997
AbsoluteFillStyle,
50004998
hairlineWidth,
50014999
absoluteFill,
5002-
absoluteFillObject,
50035000
compose,
50045001
flatten,
50055002
setStyleAttributePreprocessor,
@@ -6206,7 +6203,7 @@ export {
62066203
StatusBarProps, // 06c98add
62076204
StatusBarStyle, // 986b2051
62086205
StyleProp, // fa0e9b4a
6209-
StyleSheet, // 17b08ddb
6206+
StyleSheet, // 0040560f
62106207
SubmitBehavior, // c4ddf490
62116208
Switch, // cd54192c
62126209
SwitchChangeEvent, // 2e5bd2de

packages/react-native/types/__typetests__/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,7 @@ type ElementProps<C> = C extends React.Component<infer P, any> ? P : never;
409409
class CustomView extends React.Component {
410410
render() {
411411
return (
412-
<Text
413-
style={[StyleSheet.absoluteFill, {...StyleSheet.absoluteFillObject}]}>
412+
<Text style={[StyleSheet.absoluteFill, {...StyleSheet.absoluteFill}]}>
414413
Custom View
415414
</Text>
416415
);

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,10 +1191,7 @@ exports.examples = [
11911191
render: function (): React.Node {
11921192
return (
11931193
<View style={styles.base}>
1194-
<Image
1195-
style={{...StyleSheet.absoluteFillObject}}
1196-
source={fullImage}
1197-
/>
1194+
<Image style={{...StyleSheet.absoluteFill}} source={fullImage} />
11981195
<Text style={styles.nestedText}>React</Text>
11991196
</View>
12001197
);

0 commit comments

Comments
 (0)