[]previous and next page

isClaiming

Reports whether a hydrate() pass is claiming server DOM right now: a custom renderer reads it to decide between adopting server nodes and building fresh ones.

Reports whether a hydrate() pass is claiming server DOM right now: a custom renderer reads it to decide between adopting server nodes and building fresh ones. The pass is synchronous, so this is false again once hydrate() returns, and in every later update.

Import#

ts
import { isClaiming } from "@shadow-js/web/extend";

Signature#

ts
function isClaiming(): boolean

Returns#

true during the synchronous pass of hydrate() (outside withoutClaiming), false otherwise.

Examples#

ts
import { isClaiming } from "@shadow-js/web/extend";

function describe(): string {
  return isClaiming() ? "adopting server markup" : "building fresh DOM";
}