Skip to content

Cannot read property 'complete' of undefined #216

@lkazberova

Description

@lkazberova

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions