react-native-image-progress icon indicating copy to clipboard operation
react-native-image-progress copied to clipboard

source.uri should not be an empty string

Open Darshan972 opened this issue 5 years ago • 2 comments

Hey what the the hell is the error i am getting here please solve it . i am 16 years old right now please give a expln that i can understand perfectly.

here is the code:

constructor(props) { super(props); this.state= { imgLink: '', } };

here i am fetching it:

fetchData = data => { this.setState({imgLink: data.items[0].snippet.thumbnails.default.url}); }

onPressedButton = channelId => { // fetch the value entered in the input field //alert(channelId); this.setState({channelId:channelId}) //fetch the value(channelId) that is enter in the input field // make a request var url = 'https://www.googleapis.com/youtube/v3/channels?key='+API_Key+'&id=' + this.state.channelId + '&part=snippet,contentDetails,statistics'; this.setState({url: url}); fetch(url,{ method: 'GET' }) .then((response) => response.json()) // fetchData(data); .then((data) => { fetchData(data); alert(imgLink); }) //now fetching the response from the yt api again and again .setInterval(() => { var url = 'https://www.googleapis.com/youtube/v3/channels?key='+API_Key+'&id=' + this.state.channelId + '&part=statistics'; fetch(url,{ method: 'GET' }) .then((response) => updateSubscribers(response.json())) },0)

.catch((error) => { console.log(error); }); }

here is the render method: render() { <Image style = { {width:width,height:height,alignItems:'center',borderRadius:50 ,marginLeft:'auto',marginRight: 'auto',marginTop: 30} } source = {{uri: imgLink}}/> }

Darshan972 avatar Sep 26 '19 14:09 Darshan972

reaplace imaglink:'' to imgLink : null

chethiya44 avatar Nov 15 '19 10:11 chethiya44

Shouldn't this be imgLink || null ???

RSP531 avatar Aug 31 '20 17:08 RSP531