Skip to content

Why does the IntersectionObserver Callback only take care of the first entry? #86

@johnsmith0209

Description

@johnsmith0209
  • v3-infinite-loading@1.2.2

I was caught on an issue: When the page was mounted, not every time the @infinite event was called.

After I added console.log to the IntersectionObserver callback, I found that the entries param was an array with 2 items.

image

But the code shows that only first item of entries is used. Why ?

const entry = entries[0];

Shouldn't this code be like:

const entry = entries.at(-1);

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