Permalink
Browse files

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
  • Loading branch information...
Minishlink authored and facebook-github-bot committed Jul 23, 2017
1 parent c748d69 commit 8dea90ba8b5a6fe6fa4ded6650c2d347ffba397e
Showing with 5 additions and 3 deletions.
  1. +5 −3 docs/Images.md
View
@@ -186,13 +186,15 @@ On the user side, this lets you annotate the object with useful attributes such
## Background Image via Nesting
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.
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.
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.
```javascript
return (
<Image source={...}>
<ImageBackground source={...}>
<Text>Inside</Text>
</Image>
</ImageBackground>
);
```

0 comments on commit 8dea90b

Please sign in to comment.