Skip to content

Commit 8dea90b

Browse files
Minishlinkfacebook-github-bot
authored andcommitted
Update Images.md with ImageBackground
Summary: This part of the documentation was outdated since v0.46. :) Closes #15151 Differential Revision: D5478408 Pulled By: shergin fbshipit-source-id: a9d442560ad2768a684b9bbb11285b5f20f9d00d
1 parent c748d69 commit 8dea90b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/Images.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ On the user side, this lets you annotate the object with useful attributes such
186186

187187
## Background Image via Nesting
188188

189-
A common feature request from developers familiar with the web is `background-image`. To handle this use case, simply create a normal `<Image>` component and add whatever children to it you would like to layer on top of it.
189+
A common feature request from developers familiar with the web is `background-image`. To handle this use case, you can use the `<ImageBackground>` component, which has the same props as `<Image>`, and add whatever children to it you would like to layer on top of it.
190+
191+
You might not want to use `<ImageBackground>` in some cases, since the implementation is very simple. Refer to `<ImageBackground>`'s [source code](https://github.com/facebook/react-native/blob/master/Libraries/Image/ImageBackground.js) for more insight, and create your own custom component when needed.
190192

191193
```javascript
192194
return (
193-
<Image source={...}>
195+
<ImageBackground source={...}>
194196
<Text>Inside</Text>
195-
</Image>
197+
</ImageBackground>
196198
);
197199
```
198200

0 commit comments

Comments
 (0)