Home / Function/ useCreateFormContext() — astro Function Reference

useCreateFormContext() — astro Function Reference

Architecture documentation for the useCreateFormContext() function in Form.tsx from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  0e3306c4_c06c_bf72_6ed2_778d37c0e0fa["useCreateFormContext()"]
  6986db32_b74e_37a6_ff49_3275e975c4fb["Form.tsx"]
  0e3306c4_c06c_bf72_6ed2_778d37c0e0fa -->|defined in| 6986db32_b74e_37a6_ff49_3275e975c4fb
  4ced467d_2434_ded6_1c62_a6986a7078d5["Form()"]
  4ced467d_2434_ded6_1c62_a6986a7078d5 -->|calls| 0e3306c4_c06c_bf72_6ed2_778d37c0e0fa
  style 0e3306c4_c06c_bf72_6ed2_778d37c0e0fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/db/test/fixtures/ticketing-example/src/components/Form.tsx lines 17–27

export function useCreateFormContext(validator: FormValidator, fieldErrors?: FieldErrors) {
	const initial = getInitialFormState({ validator, fieldErrors });
	const [formState, setFormState] = useState<FormState>(initial);
	return {
		value: formState,
		set: setFormState,
		setValidationErrors: toSetValidationErrors(setFormState),
		validateField: toValidateField(setFormState),
		trackAstroSubmitStatus: toTrackAstroSubmitStatus(setFormState),
	};
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does useCreateFormContext() do?
useCreateFormContext() is a function in the astro codebase, defined in packages/db/test/fixtures/ticketing-example/src/components/Form.tsx.
Where is useCreateFormContext() defined?
useCreateFormContext() is defined in packages/db/test/fixtures/ticketing-example/src/components/Form.tsx at line 17.
What calls useCreateFormContext()?
useCreateFormContext() is called by 1 function(s): Form.

Analyze Your Own Codebase

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

Try Supermodel Free