mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-25 10:30:25 +00:00
Add imageRef prop to ImageBackground
This commit is contained in:
Vendored
+2
-1
@@ -3698,8 +3698,9 @@ export class Image extends ImageBase {
|
||||
}
|
||||
|
||||
export interface ImageBackgroundProps extends ImagePropsBase {
|
||||
style?: StyleProp<ViewStyle>;
|
||||
imageStyle?: StyleProp<ImageStyle>;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
imageRef?(image: Image): void;
|
||||
}
|
||||
|
||||
declare class ImageBackgroundComponent extends React.Component<ImageBackgroundProps> {}
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
ImageLoadEventData,
|
||||
ImageErrorEventData,
|
||||
ImageResolvedAssetSource,
|
||||
ImageBackground,
|
||||
InteractionManager,
|
||||
ListView,
|
||||
ListViewDataSource,
|
||||
@@ -661,6 +662,25 @@ export class ImageTest extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export class ImageBackgroundProps extends React.Component {
|
||||
private _imageRef: Image | null = null;
|
||||
|
||||
setImageRef = (image: Image) => {
|
||||
this._imageRef = image;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<ImageBackground
|
||||
source={{ uri: 'https://seeklogo.com/images/T/typescript-logo-B29A3F462D-seeklogo.com.png' }}
|
||||
imageRef={this.setImageRef}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class StylePropsTest extends React.PureComponent {
|
||||
render() {
|
||||
const uri = 'https://seeklogo.com/images/T/typescript-logo-B29A3F462D-seeklogo.com.png'
|
||||
|
||||
Reference in New Issue
Block a user