getClientHeight
Commons
stable
Returns the viewport height (window.innerHeight) in a browser context, or the SSR-provided clientHeight fallback when running server-side.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- ssrTSSROptions
- Optional SSR options object. When provided as an object with a clientHeight property, that value is returned instead of window.innerHeight.
API
Valeur de retour
La valeur retournée par cet util.
- The viewport height in pixels. Returns 0 when running server-side without an SSR options object.
Usage
Exemples
Extraits de code prêts à coller.
Viewport height in browser vs SSR