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 authored and meta-codesync[bot] committed 2026-02-18 03:31:49 -08:00
1 parent 3296af74e1
commit 5681db09b8
6 files changed
+4 -35

No files matched your search

@@ -127,9 +127,4 @@ export namespace StyleSheet {
* styles. * styles.
*/ */
export const absoluteFill: AbsoluteFillStyle; export const absoluteFill: AbsoluteFillStyle;
/**
* @deprecated Use `StyleSheet.absoluteFill`.
*/
export const absoluteFillObject: AbsoluteFillStyle;
} }
@@ -109,20 +109,6 @@ export default {
*/ */
absoluteFill, 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`. * 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 * 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; 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. * Combines two styles such that style2 will override any styles in style1.
* If either style is falsy, the other one is returned without allocating * 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 * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * 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. * 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 $$SwitchNativeComponent: ComponentType
declare const $$ViewNativeComponent: typeof ViewNativeComponent_default declare const $$ViewNativeComponent: typeof ViewNativeComponent_default
declare const absoluteFill: AbsoluteFillStyle declare const absoluteFill: AbsoluteFillStyle
declare const absoluteFillObject: AbsoluteFillStyle
declare const AccessibilityInfo: typeof AccessibilityInfo_default declare const AccessibilityInfo: typeof AccessibilityInfo_default
declare const AccessibilityInfo_default: { declare const AccessibilityInfo_default: {
addEventListener<K extends keyof AccessibilityEventDefinitions>( addEventListener<K extends keyof AccessibilityEventDefinitions>(
@@ -1020,7 +1019,6 @@ declare type $$ScrollViewNativeComponent = typeof $$ScrollViewNativeComponent
declare type $$SwitchNativeComponent = typeof $$SwitchNativeComponent declare type $$SwitchNativeComponent = typeof $$SwitchNativeComponent
declare type $$ViewNativeComponent = typeof $$ViewNativeComponent declare type $$ViewNativeComponent = typeof $$ViewNativeComponent
declare type absoluteFill = typeof absoluteFill declare type absoluteFill = typeof absoluteFill
declare type absoluteFillObject = typeof absoluteFillObject
declare type AbsoluteFillStyle = { declare type AbsoluteFillStyle = {
readonly bottom: 0 readonly bottom: 0
readonly left: 0 readonly left: 0
@@ -4999,7 +4997,6 @@ declare namespace StyleSheet {
AbsoluteFillStyle, AbsoluteFillStyle,
hairlineWidth, hairlineWidth,
absoluteFill, absoluteFill,
absoluteFillObject,
compose, compose,
flatten, flatten,
setStyleAttributePreprocessor, setStyleAttributePreprocessor,
@@ -6206,7 +6203,7 @@ export {
StatusBarProps, // 06c98add StatusBarProps, // 06c98add
StatusBarStyle, // 986b2051 StatusBarStyle, // 986b2051
StyleProp, // fa0e9b4a StyleProp, // fa0e9b4a
StyleSheet, // 17b08ddb StyleSheet, // 0040560f
SubmitBehavior, // c4ddf490 SubmitBehavior, // c4ddf490
Switch, // cd54192c Switch, // cd54192c
SwitchChangeEvent, // 2e5bd2de SwitchChangeEvent, // 2e5bd2de
@@ -409,8 +409,7 @@ type ElementProps<C> = C extends React.Component<infer P, any> ? P : never;
class CustomView extends React.Component { class CustomView extends React.Component {
render() { render() {
return ( return (
<Text <Text style={[StyleSheet.absoluteFill, {...StyleSheet.absoluteFill}]}>
style={[StyleSheet.absoluteFill, {...StyleSheet.absoluteFillObject}]}>
Custom View Custom View
</Text> </Text>
); );
@@ -1191,10 +1191,7 @@ exports.examples = [
render: function (): React.Node { render: function (): React.Node {
return ( return (
<View style={styles.base}> <View style={styles.base}>
<Image <Image style={{...StyleSheet.absoluteFill}} source={fullImage} />
style={{...StyleSheet.absoluteFillObject}}
source={fullImage}
/>
<Text style={styles.nestedText}>React</Text> <Text style={styles.nestedText}>React</Text>
</View> </View>
); );