My image-source is secured, so ideally I would like to do the following:
<Image source={{uri: "http://path/to/image",
headers: {Authorization: 'Bearer ' + this.props.bearerToken}}}/>
Is there anyway I can approximate that, short of loading the image into Javascript and rendering the image from there?
Go to Insert > Header or Footer > Blank. Double-click Type here in the header or footer area. Select Picture from File, choose your picture, and select Insert to add the picture.
To use an image on a webpage, use the <img> tag. The tag allows you to add image source, alt, width, height, etc. The src is to add the image URL. The alt is the alternate text attribute, which is text that is visible when the image fails to load.
The required src attribute specifies the URL of the image.
React naitve supports adding header or body in requesting image. UPDATED: See this.
<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}} />
This capability has recently been merged into React-Native: https://github.com/facebook/react-native/pull/7338/files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With