Skip to content

UseGetBody

katanakit-js / useGetBody

function useGetBody(): HTMLBodyElement | null;

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

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

HTMLBodyElement | null

The document.body element cast as HTMLBodyElement.

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