Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-native/Libraries/Image/ImageBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export type {ImageBackgroundProps} from './ImageProps';
* });
* ```
*
* ImageBackground is deprecated and will be removed in a future release.
* Use a `View` with an absolutely positioned `Image` instead.
*
* @see https://reactnative.dev/docs/imagebackground
* @deprecated
*/
class ImageBackground extends React.Component<ImageBackgroundProps> {
setNativeProps(props: {...}) {
Expand Down
8 changes: 7 additions & 1 deletion packages/react-native/Libraries/Image/ImageProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,13 @@ export type ImageProps = Readonly<{
style?: ?ImageStyleProp,
}>;

/** @build-types emit-as-interface Uniwind compatibility */
/**
* ImageBackground is deprecated and will be removed in a future release.
* Use a `View` with an absolutely positioned `Image` instead.
* @see https://reactnative.dev/docs/imagebackground
* @deprecated
* @build-types emit-as-interface Uniwind compatibility
*/
export type ImageBackgroundProps = Readonly<{
...ImageProps,
children?: React.Node,
Expand Down
11 changes: 11 additions & 0 deletions packages/react-native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,18 @@ module.exports = {
get Image() {
return require('./Libraries/Image/Image').default;
},
/**
* @deprecated ImageBackground is deprecated and will be removed in a future release.
* Use a View with an absolutely positioned Image instead.
* See https://reactnative.dev/docs/imagebackground
*/
get ImageBackground() {
warnOnce(
'image-background-deprecated',
'ImageBackground is deprecated and will be removed in a future release. ' +
'Use a View with an absolutely positioned Image instead. ' +
'See https://reactnative.dev/docs/imagebackground',
);
return require('./Libraries/Image/ImageBackground').default;
},
get InputAccessoryView() {
Expand Down
Loading