Skip to content

Commit

Permalink
Update Images.md with ImageBackground
Browse files Browse the repository at this point in the history
Summary:
This part of the documentation was outdated since v0.46. :)
Closes facebook/react-native#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 8dea90b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
```
Expand Down

0 comments on commit 8dea90b

Please sign in to comment.