Remove deprecated StyleSheet.absoluteFill API (#55541)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Alex Hunt
2026-02-18 03:31:49 -08:00
committed by meta-codesync[bot]
parent 3296af74e1
commit 5681db09b8
6 changed files with 4 additions and 35 deletions
@@ -127,9 +127,4 @@ export namespace StyleSheet {
* styles.
*/
export const absoluteFill: AbsoluteFillStyle;
/**
* @deprecated Use `StyleSheet.absoluteFill`.
*/
export const absoluteFillObject: AbsoluteFillStyle;
}
@@ -109,20 +109,6 @@ export default {
*/
absoluteFill,
/**
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
* used to create a customized entry in a `StyleSheet`, e.g.:
*
* const styles = StyleSheet.create({
* wrapper: {
* ...StyleSheet.absoluteFillObject,
* top: 10,
* backgroundColor: 'transparent',
* },
* });
*/
absoluteFillObject: absoluteFill,
/**
* Combines two styles such that `style2` will override any styles in `style1`.
* If either style is falsy, the other one is returned without allocating an
@@ -47,11 +47,6 @@ declare export const hairlineWidth: number;
*/
declare export const absoluteFill: AbsoluteFillStyle;
/**
* @deprecated Use `StyleSheet.absoluteFill`.
*/
declare export const absoluteFillObject: AbsoluteFillStyle;
/**
* Combines two styles such that style2 will override any styles in style1.
* If either style is falsy, the other one is returned without allocating
+2 -5
View File
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<6463b0a4f3acbeb07e6759c345b927d8>>
* @generated SignedSource<<70e87b8481aeab750e8c747d9d4d28b1>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
@@ -93,7 +93,6 @@ declare const $$ScrollViewNativeComponent: typeof ScrollViewNativeComponent_defa
declare const $$SwitchNativeComponent: ComponentType
declare const $$ViewNativeComponent: typeof ViewNativeComponent_default
declare const absoluteFill: AbsoluteFillStyle
declare const absoluteFillObject: AbsoluteFillStyle
declare const AccessibilityInfo: typeof AccessibilityInfo_default
declare const AccessibilityInfo_default: {
addEventListener<K extends keyof AccessibilityEventDefinitions>(
@@ -1020,7 +1019,6 @@ declare type $$ScrollViewNativeComponent = typeof $$ScrollViewNativeComponent
declare type $$SwitchNativeComponent = typeof $$SwitchNativeComponent
declare type $$ViewNativeComponent = typeof $$ViewNativeComponent
declare type absoluteFill = typeof absoluteFill
declare type absoluteFillObject = typeof absoluteFillObject
declare type AbsoluteFillStyle = {
readonly bottom: 0
readonly left: 0
@@ -4999,7 +4997,6 @@ declare namespace StyleSheet {
AbsoluteFillStyle,
hairlineWidth,
absoluteFill,
absoluteFillObject,
compose,
flatten,
setStyleAttributePreprocessor,
@@ -6206,7 +6203,7 @@ export {
StatusBarProps, // 06c98add
StatusBarStyle, // 986b2051
StyleProp, // fa0e9b4a
StyleSheet, // 17b08ddb
StyleSheet, // 0040560f
SubmitBehavior, // c4ddf490
Switch, // cd54192c
SwitchChangeEvent, // 2e5bd2de
@@ -409,8 +409,7 @@ type ElementProps<C> = C extends React.Component<infer P, any> ? P : never;
class CustomView extends React.Component {
render() {
return (
<Text
style={[StyleSheet.absoluteFill, {...StyleSheet.absoluteFillObject}]}>
<Text style={[StyleSheet.absoluteFill, {...StyleSheet.absoluteFill}]}>
Custom View
</Text>
);
@@ -1191,10 +1191,7 @@ exports.examples = [
render: function (): React.Node {
return (
<View style={styles.base}>
<Image
style={{...StyleSheet.absoluteFillObject}}
source={fullImage}
/>
<Image style={{...StyleSheet.absoluteFill}} source={fullImage} />
<Text style={styles.nestedText}>React</Text>
</View>
);