Replies: 3 comments 2 replies
|
Probably we can import some type, that is suitable for the |
0 replies
|
have you tried using condition property on the field itself? |
2 replies
|
I've resolved this by introducing two new type-safe identity helper functions: Usage Exampleimport { defineField, defineFields, defineSchema } from "@buildnbuzz/form-react";
// Define a single reusable field with strict type safety
const emailField = defineField({
type: "email",
name: "email",
label: "Email Address",
required: true,
});
// Define a reusable group of fields
const profileFields = defineFields([
{ type: "text", name: "firstName", label: "First Name" },
{ type: "text", name: "lastName", label: "Last Name" },
]);
// Compose them cleanly inside your schema
const schema = defineSchema({
fields: [emailField, ...profileFields],
}); |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I need to build the list of fields for the BuzzForm schema conditionally, so trying to do it like this:
But it leads to a TypeScript error:

How can we fix it?
All reactions