reactjs - Image tag is not rendering with 'react-native-web' -


i new react. have use case have cache image @ third party server.(want avoid many server calls render image every second) this, using react-native-web

my application react web application. code snippet is:

import { image } 'react-native-web';  class imagecomponent extends component {    componentwillmount() {     const interval = setinterval(() => { this.timer(); }, 2000);     this.setstate({ interval });     const urlofimages = ['https://homepages.cae.wisc.edu/~ece533/images/mountain.png'];      const prefetchtasks = [];      urlofimages.foreach((url) => {         prefetchtasks.push(image.prefetch(url));     }); }    render() {       const images = ['https://homepages.cae.wisc.edu/~ece533/images/mountain.png'];      const text = 'something';      return (        <div>                 <span>{ text }</span>                 <image source={{ uri: images[0] }} alt="banner" title="banner" border="0" />                <image source={{ uri: images[0] }} alt="banner" title="banner" border="0" />                 <image source={{ uri: images[0] }} alt="banner" title="banner" border="0" />                 <image source={{ uri: images[0] }} alt="banner" title="banner" border="0" />        </div>       );   }   } 

through network tab, see there one request being made download image server. expected image tag but, none of image being rendered on browser.

can please direct problem image tag isn't being rendered or there better way cache image server using react?


Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -