nope/resources/ui/forms/dynamicForm.tsx
2020-09-07 20:13:01 +02:00

24 lines
478 B
TypeScript

// https://react-jsonschema-form.readthedocs.io/en/latest/
import Form from "@rjsf/bootstrap-4";
const schema = {
"type": "object",
"properties": {
"hello": {
"type": "string"
}
},
"required": [
"hello"
]
};
const formData = "a";
const log = (type) => console.log.bind(console, type);
export default () => (
<Form schema={schema as any} formData={formData} liveValidate onSubmit={log("submitted")}>
</Form>
);