import Form from "@rjsf/core"; import type { RJSFSchema, UiSchema } from "@rjsf/utils"; import { useRef } from "react"; import { TbPlus, TbTrash } from "react-icons/tb"; import { Button } from "ui/components/buttons/Button"; import { JsonSchemaForm, type JsonSchemaFormRef } from "ui/components/form/json-schema"; import * as Formy from "../../../../components/form/Formy"; import * as AppShell from "../../../../layouts/AppShell/AppShell"; class CfJsonSchemaValidator {} export default function JsonFormTest() { const schema: RJSFSchema = { type: "object", properties: { name: { type: "string", title: "Name", minLength: 3, }, variants: { anyOf: [{ type: "string" }, { type: "number" }], }, }, }; const ref = useRef(null); function onSubmit() { console.log("submit", ref.current?.formData()); console.log("isvalid", ref.current?.validateForm()); } return ( <> Submit } > JSON Schema
Name Options
); }