close

React JSON Schema Form Refs Guide

If your schema has $ref and your current form stack gives you a dramatic runtime monologue, this page is for you.

formhell supports peer schemas, async schema fetches, and modern JSON Schema workflows so reference-heavy forms stay predictable.

Basic peer schema pattern

<SchemaForm
  schema={mainSchema}
  peerSchemas={[addressSchema, countrySchema]}
/>

Async missing-schema pattern

<SchemaForm
  schema={mainSchema}
  getSchema={async (requestedSchema) => {
    const response = await fetch(`/api/schema?ref=${encodeURIComponent(requestedSchema)}`);
    if (!response.ok) throw new Error("Unable to load schema");
    return await response.json();
  }}
/>

Related resources