Home / Function/ validateComponentProps() — astro Function Reference

validateComponentProps() — astro Function Reference

Architecture documentation for the validateComponentProps() function in instance.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  041b340b_266d_1f41_f405_8ebb1b196564["validateComponentProps()"]
  1be70ad0_d3b6_9a94_47c0_3985acb68eaf["instance.ts"]
  041b340b_266d_1f41_f405_8ebb1b196564 -->|defined in| 1be70ad0_d3b6_9a94_47c0_3985acb68eaf
  25a504fc_665b_a586_21a2_2584388b54c8["createAstroComponentInstance()"]
  25a504fc_665b_a586_21a2_2584388b54c8 -->|calls| 041b340b_266d_1f41_f405_8ebb1b196564
  style 041b340b_266d_1f41_f405_8ebb1b196564 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/astro/instance.ts lines 88–103

function validateComponentProps(
	props: ComponentProps,
	clientDirectives: SSRResult['clientDirectives'],
	displayName: string,
) {
	if (props != null) {
		const directives = [...clientDirectives.keys()].map((directive) => `client:${directive}`);
		for (const prop of Object.keys(props)) {
			if (directives.includes(prop)) {
				console.warn(
					`You are attempting to render <${displayName} ${prop} />, but ${displayName} is an Astro component. Astro components do not render in the client and should not have a hydration directive. Please use a framework component for client rendering.`,
				);
			}
		}
	}
}

Domain

Subdomains

Frequently Asked Questions

What does validateComponentProps() do?
validateComponentProps() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/astro/instance.ts.
Where is validateComponentProps() defined?
validateComponentProps() is defined in packages/astro/src/runtime/server/render/astro/instance.ts at line 88.
What calls validateComponentProps()?
validateComponentProps() is called by 1 function(s): createAstroComponentInstance.

Analyze Your Own Codebase

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

Try Supermodel Free