Preload does not seem to be working
See original GitHub issueHi everyone, I need to preload 6 images (probably more in the future) when my app opens. I am using the following code in the componentDidMount method of my App.js:
await FastImage.preload([{ uri: 'https://app.box.com/shared/static/dz6tvgka56ub8xfii6v4516zco0bmvwq.jpg' }])
await FastImage.preload([{ uri: 'https://app.box.com/shared/static/8e43tmaproz9psvch4s7de5tyff9i71k.jpg' }])
await FastImage.preload([{ uri: 'https://app.box.com/shared/static/udiaehxve4tjunnhe40wtvddvp8h3hdo.jpg' }])
await FastImage.preload([{ uri: 'https://app.box.com/shared/static/6rbqggrctvsjgebxmr2u630u081w3rrz.jpg' }])
await FastImage.preload([{ uri: 'https://app.box.com/shared/static/n4fym1ck83nmlo0uo20clpwidipr3e56.jpg' }])
await FastImage.preload([{ uri: 'https://app.box.com/shared/static/e1fiqrjwqhm5vh77znjr1gfiy5kclw94.jpg' }])
It does not seems to do anything because i can see blank space while the image are being loaded after my app launched. I am using react native on my ios simulator. I know other issues have been opened in the past but I feel like none of them solved my problem.
Thanks very much in advance.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Common problems with rel="preload" - DebugBear
First, let's look at how preload is supposed to work. ... A CSS file references a font, but this font doesn't start loading...
Read more >css - rel=preload for stylesheet isn't applying the styles once ...
I'm testing in Chrome 61, and I can see that the stylesheets are downloaded as expected, however they're never actually applied, and I...
Read more >'Preload now' doesn't seem to work properly - WordPress.org
Hello,. As i say in the title, the preload now function doesn't seem to work properly. It supposedly simulates the 'visit' of a...
Read more >Question - Preload table does not seem to work - Unity Forum
Hi all, I have a simple StringTable containing one single string entry translated in only one locale. I have checked the "Preload All ......
Read more >IIS Preload feature doesn't work when "SSL Settings" is set to ...
Upon further diagnosis I found out that as long as I set my application to be "SSL Required" , which I initially did,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
its sad that FastImage.preload() does not return a promise , as I need to download 100 images and I do not know if they are loaded or not .
Hi @amitbravo, This a tricky situation. Does your questionaire is changing dynamically ? If no you can just hardcode your Images with require and store them locally. I’m not a massive of this solution to be honest.
Otherwise you can have a look at this module (https://github.com/kfiroo/react-native-cached-image) which is a bit faster than FastImage to load and you can make your images FadesIn in order to make it smooth.
Hope it helped, good luck man!