Skip to content

Commit a2b6c6d

Browse files
fix: allow no options (#11)
* feat: custom form fields * feat: validation and separate package * docs: update import * fix: allow no options if not needed
1 parent 9eecb41 commit a2b6c6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/form-schema/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ interface FormSchemaPluginOptions {
2626
fields?: FieldsOption
2727
}
2828

29-
export const formSchema = definePlugin(({fields = []}: FormSchemaPluginOptions) => {
29+
export const formSchema = definePlugin((options: FormSchemaPluginOptions | undefined) => {
3030
return {
3131
name: 'form-toolkit_form-schema',
32-
schema: schema(fields),
32+
schema: schema(options?.fields ?? []),
3333
// plugins: [structureTool({defaultDocumentNode})],
3434
}
3535
})

0 commit comments

Comments
 (0)