-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'complete' of undefined #216
Comments
Any update? Same boat here. |
0.5.17 not working either |
plus one |
+1 |
is this repo alive?? |
If someone would like to get the react-images without this error please free to use "react-images": "git://github.com/lkazberova/react-images.git#libs", in your package.json, because we don't know when an author of this repo will accept the pull-request. |
@jossmac Understanding v1 is around the corner, is there anything specific that prevents this PR from being merged and released? |
According to the source code, the error happens when you set images props as an empty array, my fix way is: |
Fix #216 Cannot read property 'complete' of undefined
Steps to reproduce the behavior:
Set images & isOpen=true in one step. Please take a look at this https://codesandbox.io/s/k04jp5y447
Expected behavior:
Galllery is open
Actual behavior:
Gallery crash with error "Cannot read property 'complete' of undefined"
Why:
In this code we call preloadImage https://github.com/jossmac/react-images/blob/master/src/Lightbox.js#L89, but in preloadImage method we try to access "old" state of this.props.images https://github.com/jossmac/react-images/blob/master/src/Lightbox.js#L112
The text was updated successfully, but these errors were encountered: