Skip to content

Is the default prop "root" of "InView" is "Document"? #444

Closed Answered by thebuilder
xyy94813 asked this question in Q&A
Discussion options

You must be logged in to vote

The default value is whatever the browser sets as the default, which is the browser viewport.

If root is null, then the owning document is used as the root, and the bounds its viewport (that is, the visible area of the document) are used as the root bounds.
https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/root

I think the one you're looking at, is for handling a child document (e.g. iframe).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@eric-cortes
Comment options

@thebuilder
Comment options

Answer selected by thebuilder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants