Skip to content
0

katanakit-js / useGetBody

Function: useGetBody() ​

ts
function useGetBody(): HTMLBodyElement | null;

Defined in: src/infrastructure/dom/dom.service.ts:57

Returns the <body> element, or null outside a browser.

Returns ​

HTMLBodyElement | null

The document.body element cast as HTMLBodyElement.

Example ​

ts
const body = useGetBody();
body?.classList.add("loaded");

Released under the MIT License.