React-native-fast-image: Getting a wired behavior bug with activity indicator

Created on 8 Aug 2017  路  11Comments  路  Source: DylanVann/react-native-fast-image

When I load my app and if go to my photo tabs which loads images from my redux store activity indicator is showing but does not go away attached gif showing the issue
fast-image-issue

I don't think it's getting the correct events

Most helpful comment

Same here. I tried to debug it some more.

These are the events that are dispatched when:

I load the image for the first time:

  • onLoadStart - once
  • onProgress - multiple times
  • onLoad
  • onLoadEnd
  • the indicator disappears

When I reload the app and view the image: - This image is loaded from cache I assume

  • onLoadStart - once
  • the indicator stays on screen

Strange behavior:

  • When I add the onLoadEnd event with an empty handler like so: onLoadEnd={() => {}} the indicator does disappear when I re-view the image.

Proposed solution
Maybe it is a good idea to make the api/event dispatching consistent by also firing the onLoadEnd, and the onLoad when appropriate, event when the image is loaded from cache. These changes will also benefit components and issues like: https://github.com/oblador/react-native-image-progress/issues/55

Let me know what your opinions are so we can fix this :)

All 11 comments

Make sure you rebuild the app if you just updated. I'll try out something like this and see if I have any issues.

Yes I rebuild the app but still getting this issue

Same here

+1

+1

Same here. I tried to debug it some more.

These are the events that are dispatched when:

I load the image for the first time:

  • onLoadStart - once
  • onProgress - multiple times
  • onLoad
  • onLoadEnd
  • the indicator disappears

When I reload the app and view the image: - This image is loaded from cache I assume

  • onLoadStart - once
  • the indicator stays on screen

Strange behavior:

  • When I add the onLoadEnd event with an empty handler like so: onLoadEnd={() => {}} the indicator does disappear when I re-view the image.

Proposed solution
Maybe it is a good idea to make the api/event dispatching consistent by also firing the onLoadEnd, and the onLoad when appropriate, event when the image is loaded from cache. These changes will also benefit components and issues like: https://github.com/oblador/react-native-image-progress/issues/55

Let me know what your opinions are so we can fix this :)

Any update on this? @DylanVann Thanks in advance!

@DylanVann Yesh this still exists. Especially on IOS 9, the spinner wont just go away even if I add the empty onLoadEnd{() => {}}.
P

@AlmogRnD Try this. Somebody make a PR
https://github.com/DylanVann/react-native-fast-image/pull/74/files

Also can you suggest something on how to implement placeholder images (on similar lines as loading spinner)

my solution

<FastImage
  source={source}
  style={StyleSheet.absoluteFill}
  onLoadStart={() => this.onLoadStart()}
  onProgress={e => {}}
  onLoad={() => this.onLoad()}
  onError={() => {}}
  onLoadEnd={() => {}}
/>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kkarmalkar picture kkarmalkar  路  4Comments

baba43 picture baba43  路  3Comments

Andarius picture Andarius  路  3Comments

banphlet picture banphlet  路  3Comments

mschipperheyn picture mschipperheyn  路  3Comments