Show loader until live link image does not load completely React native 0.58What's the best way to add a full screen background image in React NativeDoes react native support base64 encoded images?Hide/Show components in react nativeReact Native - open links in browserError on load image on React-native: Unexpected characterHow to enable live reload in react native on android?React Native Animated, Complete EventWhat is the difference between Hot Reloading and Live Reloading in React Native?React Native: `Image` does show the `uri` sourceHow can I show loader in react-native until the response is fetched
The monorail explodes before I can get on it
Alternatives to using writing paper for writing practice
Filtering fine silt/mud from water (not necessarily bacteria etc.)
Are local nested functions possible in elisp?
Is purchasing foreign currency before going abroad a losing proposition?
What does `[$'rn']` mean?
limit of the integral in the anti-transform
Historic symbols representing peasants/oppressed persons fighting back?
Ways to express "The reader may wish to..." / "The reader may want to..."
Why does the autopilot disengage even when it does not receive pilot input?
What's the point of this scene involving Flash Thompson at the airport?
Assistant professor does not collaborate with or cite fellow department members, despite them being experts on the topic
How do Windows version numbers work?
When is pointing out a person's hypocrisy not considered to be a logical fallacy?
Do native speakers use ZVE or CPU?
Are there any double stars that I can actually see orbit each other?
Dropping outliers based on "2.5 times the RMSE"
Can I intentionally omit previous work experience or pretend it doesn't exist when applying for jobs?
What does "Fotze" really mean?
Are randomly-generated passwords starting with "a" less secure?
Why would guns not work in the dungeon?
Cubic programming and beyond?
Optimising Table wrapping over a Select
How many matrices verify this equality?
Show loader until live link image does not load completely React native 0.58
What's the best way to add a full screen background image in React NativeDoes react native support base64 encoded images?Hide/Show components in react nativeReact Native - open links in browserError on load image on React-native: Unexpected characterHow to enable live reload in react native on android?React Native Animated, Complete EventWhat is the difference between Hot Reloading and Live Reloading in React Native?React Native: `Image` does show the `uri` sourceHow can I show loader in react-native until the response is fetched
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am receiving a JSON array from an api where images have a live link. So, after the success I am rendering the data, problem is I want to show an gif until the images load completely.
The array is:-
[
"category": "Loose Flower",
"id": "7",
"product_name": "Drb,Tls,Blpt,Nlknt",
"unit_price": "0",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513948635octa_pooja_basket_w_handle6_580x@2x.jpg",
"count": 0,
"is_loaded": true
,
"category": "Loose Flower",
"id": "1",
"product_name": "Genda",
"unit_price": "0.5",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513947159genda.png",
"count": 0,
"is_loaded": true
]
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source=(this.state.singlepack.is_loaded) ? uri:
this.state.singlepack.img_path :
require('../../../../assets/flower-loader.gif')
onLoadStart=(e) =>
this.changeImageLoadStatusOnStart(this.props.singleData.id)
onLoadEnd=(e) =>
this.changeImageLoadStatusOnEnd(this.props.singleData.id)
/>
changeImageLoadStatusOnStart = (id)=>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded : false
)
changeImageLoadStatusOnEnd = (id) =>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded: true
)
I have tried the onLoadStart and onLoadEnd but I am unable to make the logic, can I have some help?
react-native reactive-programming
add a comment |
I am receiving a JSON array from an api where images have a live link. So, after the success I am rendering the data, problem is I want to show an gif until the images load completely.
The array is:-
[
"category": "Loose Flower",
"id": "7",
"product_name": "Drb,Tls,Blpt,Nlknt",
"unit_price": "0",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513948635octa_pooja_basket_w_handle6_580x@2x.jpg",
"count": 0,
"is_loaded": true
,
"category": "Loose Flower",
"id": "1",
"product_name": "Genda",
"unit_price": "0.5",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513947159genda.png",
"count": 0,
"is_loaded": true
]
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source=(this.state.singlepack.is_loaded) ? uri:
this.state.singlepack.img_path :
require('../../../../assets/flower-loader.gif')
onLoadStart=(e) =>
this.changeImageLoadStatusOnStart(this.props.singleData.id)
onLoadEnd=(e) =>
this.changeImageLoadStatusOnEnd(this.props.singleData.id)
/>
changeImageLoadStatusOnStart = (id)=>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded : false
)
changeImageLoadStatusOnEnd = (id) =>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded: true
)
I have tried the onLoadStart and onLoadEnd but I am unable to make the logic, can I have some help?
react-native reactive-programming
add a comment |
I am receiving a JSON array from an api where images have a live link. So, after the success I am rendering the data, problem is I want to show an gif until the images load completely.
The array is:-
[
"category": "Loose Flower",
"id": "7",
"product_name": "Drb,Tls,Blpt,Nlknt",
"unit_price": "0",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513948635octa_pooja_basket_w_handle6_580x@2x.jpg",
"count": 0,
"is_loaded": true
,
"category": "Loose Flower",
"id": "1",
"product_name": "Genda",
"unit_price": "0.5",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513947159genda.png",
"count": 0,
"is_loaded": true
]
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source=(this.state.singlepack.is_loaded) ? uri:
this.state.singlepack.img_path :
require('../../../../assets/flower-loader.gif')
onLoadStart=(e) =>
this.changeImageLoadStatusOnStart(this.props.singleData.id)
onLoadEnd=(e) =>
this.changeImageLoadStatusOnEnd(this.props.singleData.id)
/>
changeImageLoadStatusOnStart = (id)=>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded : false
)
changeImageLoadStatusOnEnd = (id) =>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded: true
)
I have tried the onLoadStart and onLoadEnd but I am unable to make the logic, can I have some help?
react-native reactive-programming
I am receiving a JSON array from an api where images have a live link. So, after the success I am rendering the data, problem is I want to show an gif until the images load completely.
The array is:-
[
"category": "Loose Flower",
"id": "7",
"product_name": "Drb,Tls,Blpt,Nlknt",
"unit_price": "0",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513948635octa_pooja_basket_w_handle6_580x@2x.jpg",
"count": 0,
"is_loaded": true
,
"category": "Loose Flower",
"id": "1",
"product_name": "Genda",
"unit_price": "0.5",
"img_path": "http://prabhujionline.com/bo/upload/product_img/1513947159genda.png",
"count": 0,
"is_loaded": true
]
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source=(this.state.singlepack.is_loaded) ? uri:
this.state.singlepack.img_path :
require('../../../../assets/flower-loader.gif')
onLoadStart=(e) =>
this.changeImageLoadStatusOnStart(this.props.singleData.id)
onLoadEnd=(e) =>
this.changeImageLoadStatusOnEnd(this.props.singleData.id)
/>
changeImageLoadStatusOnStart = (id)=>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded : false
)
changeImageLoadStatusOnEnd = (id) =>
this.setState(
singlepack:
...this.state.singlepack,
is_loaded: true
)
I have tried the onLoadStart and onLoadEnd but I am unable to make the logic, can I have some help?
react-native reactive-programming
react-native reactive-programming
asked Mar 26 at 5:10
Sandip NagSandip Nag
1753 silver badges13 bronze badges
1753 silver badges13 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Try this:
class YourComponent extends React.Component
render()
return data.map(( img_path ) => (
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source= uri: img_path
loadingIndicatorSource=
uri: require('../../../../assets/flower-loader.gif'),
/>
));
}
OR THIS
class YourComponent extends React.Component
state =
imgsLoaded: data.map(() => false),
;
componentDidMount()
for (let i = 0; i < data.length; i++)
Image.prefetch(data[i].img_path, () =>
const imgsLoaded = this.state;
const imgsLoadedUpdated = imgsLoaded.slice();
imgsLoadedUpdated[i] = true;
this.setState( imgsLoaded: imgsLoadedUpdated );
);
render()
const imgsLoaded = this.state;
return data.map(( img_path , index) => (
<Image
source=
uri: imgsLoaded[index]
? img_path
: require('../../../../assets/flower-loader.gif'),
/>
));
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350222%2fshow-loader-until-live-link-image-does-not-load-completely-react-native-0-58%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this:
class YourComponent extends React.Component
render()
return data.map(( img_path ) => (
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source= uri: img_path
loadingIndicatorSource=
uri: require('../../../../assets/flower-loader.gif'),
/>
));
}
OR THIS
class YourComponent extends React.Component
state =
imgsLoaded: data.map(() => false),
;
componentDidMount()
for (let i = 0; i < data.length; i++)
Image.prefetch(data[i].img_path, () =>
const imgsLoaded = this.state;
const imgsLoadedUpdated = imgsLoaded.slice();
imgsLoadedUpdated[i] = true;
this.setState( imgsLoaded: imgsLoadedUpdated );
);
render()
const imgsLoaded = this.state;
return data.map(( img_path , index) => (
<Image
source=
uri: imgsLoaded[index]
? img_path
: require('../../../../assets/flower-loader.gif'),
/>
));
add a comment |
Try this:
class YourComponent extends React.Component
render()
return data.map(( img_path ) => (
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source= uri: img_path
loadingIndicatorSource=
uri: require('../../../../assets/flower-loader.gif'),
/>
));
}
OR THIS
class YourComponent extends React.Component
state =
imgsLoaded: data.map(() => false),
;
componentDidMount()
for (let i = 0; i < data.length; i++)
Image.prefetch(data[i].img_path, () =>
const imgsLoaded = this.state;
const imgsLoadedUpdated = imgsLoaded.slice();
imgsLoadedUpdated[i] = true;
this.setState( imgsLoaded: imgsLoadedUpdated );
);
render()
const imgsLoaded = this.state;
return data.map(( img_path , index) => (
<Image
source=
uri: imgsLoaded[index]
? img_path
: require('../../../../assets/flower-loader.gif'),
/>
));
add a comment |
Try this:
class YourComponent extends React.Component
render()
return data.map(( img_path ) => (
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source= uri: img_path
loadingIndicatorSource=
uri: require('../../../../assets/flower-loader.gif'),
/>
));
}
OR THIS
class YourComponent extends React.Component
state =
imgsLoaded: data.map(() => false),
;
componentDidMount()
for (let i = 0; i < data.length; i++)
Image.prefetch(data[i].img_path, () =>
const imgsLoaded = this.state;
const imgsLoadedUpdated = imgsLoaded.slice();
imgsLoadedUpdated[i] = true;
this.setState( imgsLoaded: imgsLoadedUpdated );
);
render()
const imgsLoaded = this.state;
return data.map(( img_path , index) => (
<Image
source=
uri: imgsLoaded[index]
? img_path
: require('../../../../assets/flower-loader.gif'),
/>
));
Try this:
class YourComponent extends React.Component
render()
return data.map(( img_path ) => (
<Image
style= height: 212 / 3, width: 300 / 3, borderRadius: 5
source= uri: img_path
loadingIndicatorSource=
uri: require('../../../../assets/flower-loader.gif'),
/>
));
}
OR THIS
class YourComponent extends React.Component
state =
imgsLoaded: data.map(() => false),
;
componentDidMount()
for (let i = 0; i < data.length; i++)
Image.prefetch(data[i].img_path, () =>
const imgsLoaded = this.state;
const imgsLoadedUpdated = imgsLoaded.slice();
imgsLoadedUpdated[i] = true;
this.setState( imgsLoaded: imgsLoadedUpdated );
);
render()
const imgsLoaded = this.state;
return data.map(( img_path , index) => (
<Image
source=
uri: imgsLoaded[index]
? img_path
: require('../../../../assets/flower-loader.gif'),
/>
));
edited Mar 26 at 5:42
answered Mar 26 at 5:26
Hend El-SahliHend El-Sahli
1,4651 gold badge3 silver badges16 bronze badges
1,4651 gold badge3 silver badges16 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350222%2fshow-loader-until-live-link-image-does-not-load-completely-react-native-0-58%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown