THAPA TECHNICAL

HOUSE OF WEB DEVELOPERS AND TECHNOLOGY.

Infinite Scrolling in React JS

window.innerHeight returns the inner height of the window (the height of the browser window's viewport), in pixels.


document.documentElement.scrollTop returns the number of pixels that the document has been scrolled vertically.


document.documentElement.scrollHeight returns the height of the entire document, in pixels.


The inner height of the window is the height of the viewable area of the webpage, which is the height of the browser window's viewport. The scroll height is the total height of the webpage, including any content that extends beyond the viewable area and requires scrolling to see.


So, window.innerHeight is the height of the viewport, document.documentElement.scrollTop is the number of pixels the document has been scrolled, and document.documentElement.scrollHeight is the height of the entire document.


DOWNLOAD SOURCE CODE ;