nope/pages/test/test-input.tsx

31 lines
708 B
TypeScript
Raw Normal View History

2020-10-25 20:14:51 +00:00
// https://react-jsonschema-form.readthedocs.io/en/latest/
import Form from "@rjsf/bootstrap-4";
2020-10-26 07:39:34 +00:00
import DynamicForm from '../../resources/ui/forms/dynamicForm'
2020-10-25 20:14:51 +00:00
const schema = {
"type": "object",
"properties": {
"hello": {
"type": "string"
}
},
"required": [
"hello"
]
2020-10-26 07:39:34 +00:00
} as any;
2020-10-25 20:14:51 +00:00
const formData = {hello:"world"};
const log = (type) => console.log.bind(console, type);
2020-10-26 07:39:34 +00:00
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;