x-render
x-render copied to clipboard
[BUG]请问一下像这种FormRender在子组件里parent如何获取所有表单的输入值
import React from 'react';
import FormRender, { useForm } from 'form-render';
const Child= (props) => {
const {schema} = props
const form = useForm();
const onFinish = (data, errors) => {
console.log(errors, data);
};
return (
<div>
<FormRender
form={form}
schema={schema}
onFinish={onFinish}
/>
</div>
);
}
const Parent = (props) => {
const schemaA = {
type: 'object',
properties: {
"input1": {
"title": "简单输入框",
"type": "string",
},
}
};
const schemaB = {
type: 'object',
properties: {
"input1": {
"title": "简单输入框",
"type": "string",
},
}
};
return(
<div>
<Child schema={schemaA} />
<Child schema={schemaB} />
</div>
);
};
export default Parent;
issue里不对用法做解答,可以到答疑群里咨询。