Skip to content

Commit

Permalink
Added documentation for additional fields of Image
Browse files Browse the repository at this point in the history
Summary:
Hi there,

As ospfranco found there is some documentation for the code coming from facebook#7338 missing, so I added it. It concerns the method, headers and bdoy field on the Image source object.

If you would like to have any changes made, please don't hesitate to comment, I will add them.

Have a nice day and thank you for maintaining React Native!
Closes facebook#9304

Differential Revision: D4913262

Pulled By: javache

fbshipit-source-id: 922430ec3388560686e1cf53cb5dff7f30e4e31f
  • Loading branch information
DanielMSchmidt authored and Maxime Aoustin committed Apr 19, 2017
1 parent 4e87964 commit 94b3816
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@ Many of the images you will display in your app will not be available at compile
<Image source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}} />
```

### Network Requests for Images

If you would like to set such things as the HTTP-Verb, Headers or a Body along with the image request, you may do this by defining these properties on the source object:

```javascript
<Image source={{
uri: 'https://facebook.github.io/react/img/logo_og.png',
method: 'POST',
headers: {
Pragma: 'no-cache'
},
body: 'Your Body goes here'
}}
style={{width: 400, height: 400}} />
```

### Cache Control (iOS Only)

In some cases you might only want to display an image if it is already in the local cache, i.e. a low resolution placeholder until a higher resolution is available. In other cases you do not care if the image is outdated and are willing to display an outdated image to save bandwidth. The `cache` source property gives you control over how the network layer interacts with the cache.
Expand Down

0 comments on commit 94b3816

Please sign in to comment.