Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { theme, ...formProps } = this.props;
const { schemaStr } = this.state;
const FormRender = theme === 'antd' ? AntdComp : FusionComp;
let schema = {};
try {
schema = parseJson(schemaStr);
} catch (error) {
console.log(error);
}
const { propsSchema = {}, uiSchema = {}, formData = {} } = schema;
return (
<div>
<div>
{}}
className="flex flex-column"
style={{ overflow: 'auto' }}
>
</div></div>
tryParse = schemaStr => {
let schema = {};
try {
schema = parseJson(schemaStr);
if (typeof schema !== 'object') {
this.setState({ error: 'schema非正确json' });
return;
}
this.setState({ error: '' });
return schema;
} catch (error) {
this.setState({ error: String(error) });
}
};