nope/pages/test/test-input.tsx
2020-10-26 08:39:34 +01:00

31 lines
708 B
TypeScript

// https://react-jsonschema-form.readthedocs.io/en/latest/
import Form from "@rjsf/bootstrap-4";
import DynamicForm from '../../resources/ui/forms/dynamicForm'
const schema = {
"type": "object",
"properties": {
"hello": {
"type": "string"
}
},
"required": [
"hello"
]
} as any;
const formData = {hello:"world"};
const log = (type) => console.log.bind(console, type);
const test = () => {
const onSubmit = async data => {
console.log(data);
}
const onCancel = async err => {
console.log('canceled',err)
}
return (
<DynamicForm schema={schema} onSubmit={onSubmit} onCancel={onCancel}/>
)};
export default test;