Comments (2)
The getFieldsetConstraint
helper returns only the constraint of the top level schema. If you have a nested schema, please call the helper again with the inner schema to derive the corresponding constraint and pass it to useFieldset like this:
const itemSchema = z.object({
// ...
});
const schema = z.object({
items: z.array(itemSchema),
});
function ItemFieldset() {
const fieldset = useFieldset(ref, {
constraint: getFieldsetConstraint(itemSchema),
// ...
})
// ...
}
There will be a new helper getConstraint(schema)
that derive constraint from nested schema soon.
from conform.
great, @edmundhung , appreciate the quick response!
works exactly as you mentioned 👍
from conform.
Related Issues (20)
- When opening the React developer tools and pointing to a component using `useForm`, there is an error displaying component properties HOT 1
- Conditional fields lose their value when not present HOT 1
- docs: no ids for `h3` headings, leading to 404 links
- Selecting a file with file input does not change form.dirty value to true
- superRefine not working with descriminatedUnion
- Form#:rf: does not exist HOT 2
- Make discriminated unions merge when using getFieldset / getFieldList HOT 2
- `FormStateInput` Form state not persisted HOT 3
- File input not marked as dirty if useForm's defaultValue is defined HOT 1
- `useControl` strange behaviour HOT 1
- Conform breaks Remix <Form /> submission with clientAction HOT 1
- Default value breaks types HOT 5
- [v1] defaultValue being cached HOT 10
- Insert, remove and reorder intents do not work with button type = button HOT 1
- field.value and useInputControl().value does not stay in sync HOT 3
- Next.js 14 error after return submission.reply() HOT 1
- Inserting to a nested fieldlist reset last value HOT 15
- [Docs]: Make TOC dropdown links more obvious HOT 1
- Property 'getFieldset' does not exist on type 'FieldMetadata' HOT 6
- Expose type that is attached to `fields` to able to properly type when passing `fields` as a prop to child components
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conform.