Home / Function/ props_id() — svelte Function Reference

props_id() — svelte Function Reference

Architecture documentation for the props_id() function in template.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  63b24d3c_e321_3be2_8018_548ebe645dfb["props_id()"]
  2ab7c579_f011_f472_7847_c9e9979c6b2a["template.js"]
  63b24d3c_e321_3be2_8018_548ebe645dfb -->|defined in| 2ab7c579_f011_f472_7847_c9e9979c6b2a
  b31601aa_35ce_7827_5394_99fb97fa27d2["hydrate_next()"]
  63b24d3c_e321_3be2_8018_548ebe645dfb -->|calls| b31601aa_35ce_7827_5394_99fb97fa27d2
  style 63b24d3c_e321_3be2_8018_548ebe645dfb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/client/dom/template.js lines 375–392

export function props_id() {
	if (
		hydrating &&
		hydrate_node &&
		hydrate_node.nodeType === COMMENT_NODE &&
		hydrate_node.textContent?.startsWith(`$`)
	) {
		const id = hydrate_node.textContent.substring(1);
		hydrate_next();
		return id;
	}

	// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes
	(window.__svelte ??= {}).uid ??= 1;

	// @ts-expect-error
	return `c${window.__svelte.uid++}`;
}

Domain

Subdomains

Frequently Asked Questions

What does props_id() do?
props_id() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/dom/template.js.
Where is props_id() defined?
props_id() is defined in packages/svelte/src/internal/client/dom/template.js at line 375.
What does props_id() call?
props_id() calls 1 function(s): hydrate_next.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free