Skip to content

IntersectionObserver.unobserve: Argument 1 is not an object. #114

Closed
@crisboarna

Description

@crisboarna

Bug description
When the LazyLoadImage component is used in a component that is not visible in the window, the componentWillUnmount lifecycle method is called by React on it. If I do not scroll down to have it become visible and instead perform a navigation to a different page, the componentWillUnmount is called again, at which point this.placeholder is null (see screenshot, I added console.log at line 54 in resulting in src/components/PlaceholderWithoutTracking.jsx)

Uncaught TypeError: IntersectionObserver.unobserve: Argument 1 is not an object.

To Reproduce
Paste the code that is producing the issue

<LazyLoadImage
              key={idx}
              src={tool.image}
              alt={tool.name}
              effect={'blur'}
            />

Expected behavior
Navigation to next page to happen without error.

Screenshots
CleanShot 2022-11-07 at 14 04 32@2x

Technical details:

  • Package version: 1.5.5
  • Server Side Rendering: No
  • Device: Any
  • Operating System: Any
  • Browser: Any

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