Skip to content

Commit 2e66ac8

Browse files
sherginfacebook-github-bot
authored andcommitted
<ImageBackground> got imageRef and imageStyle props
Summary: It can be useful when you want to setup `tintColor` for the image or get a reference to call `setNativeProps` then. Reviewed By: ericvicenti Differential Revision: D5158908 fbshipit-source-id: 873c1cae9bd0af711a42016dcc548231e3cf89e7
1 parent d41c9d9 commit 2e66ac8

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Libraries/Image/ImageBackground.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,23 @@ const View = require('View');
4242
*/
4343
class ImageBackground extends React.Component {
4444
render() {
45-
const {children, style, ...props} = this.props;
45+
const {children, style, imageStyle, imageRef, ...props} = this.props;
46+
4647
return (
4748
<View style={style}>
4849
<Image
4950
{...props}
50-
style={{
51-
position: 'absolute',
52-
left: 0,
53-
right: 0,
54-
top: 0,
55-
bottom: 0,
56-
}}
51+
style={[
52+
{
53+
position: 'absolute',
54+
left: 0,
55+
right: 0,
56+
top: 0,
57+
bottom: 0,
58+
},
59+
imageStyle,
60+
]}
61+
ref={imageRef}
5762
/>
5863
{children}
5964
</View>

0 commit comments

Comments
 (0)